ACOS 6.0.4
axapi 6.0.4
Due to the on-box limitations of A10 Thunder 1040 ACME implimentation, we have a need to generate certificates elsewhere and shuttle them in.
Using the following ansible playbook part:
Expected Behavior is for the playbook to identify whether the cert exists or doesn’t on the a10 partition. If it doesn’t exist, use action: import. If it does exist, use action: replace. This does indeed do that, and imports the cert, chain, and key. When it sets to replace, the playbook completes and seemingly is ok, however the certificate, key, and chain do not get replaced. I’m wondering if anyone has run into this issue before and how you’ve gotten around it. This is true for certs, keys and chains that are not bound to an ssl template, when they are, and when they are and the ssl template is part of an slb deployment. I’ve observed no difference among those 3 scenarios.
- name: "Probe for existing certificate on {{ current_location }}"
a10.acos_axapi.a10_file_ssl_cert:
ansible_host: "{{ current_location }}"
ansible_username: "{{ ansible_username }}"
ansible_password: "{{ ansible_password }}"
ansible_port: "{{ ansible_port }}"
a10_partition: "{{ slb_data[0].value.partition }}"
file: "{{ vip }}"
state: present
check_mode: true
register: cert_probe
failed_when: false
- name: "Determine A10 Action for {{ current_location }}"
set_fact:
a10_action: "{{ 'replace' if (cert_probe.axapi_calls | string is search(vip)) else 'import' }}"
- name: "Decision Log"
ansible.builtin.debug:
msg: "Targeting {{ current_location }}. Selected Action: [{{ a10_action }}]"
- name: "Deliver Cert and Chain to {{ current_location }}"
a10.acos_axapi.a10_file_ssl_cert:
ansible_host: "{{ current_location }}"
ansible_username: "{{ ansible_username }}"
ansible_password: "{{ ansible_password }}"
ansible_port: "{{ ansible_port }}"
a10_partition: "{{ slb_data[0].value.partition }}"
state: present
action: "{{ a10_action }}"
file: "{{ item.name }}"
file_handle: "{{ item.name }}"
file_path: "{{ item.path }}"
certificate_type: pem
loop:
- { path: "{{ cert_path }}", name: "{{ vip }}" }
- { path: "{{ chain_path }}", name: "{{ vip }}_full_chain" }
throttle: 1
- name: "Deliver Private Key to {{ current_location }}"
a10.acos_axapi.a10_file_ssl_key:
ansible_host: "{{ current_location }}u"
ansible_username: "{{ ansible_username }}"
ansible_password: "{{ ansible_password }}"
ansible_port: "{{ ansible_port }}"
a10_partition: "{{ slb_data[0].value.partition }}"
state: present
action: "{{ a10_action }}"
file: "{{ vip }}"
file_handle: "{{ vip }}"
file_path: "{{ key_path }}"
throttle: 1