From 558315d68ea8c28cdcf99f441d4851484e329c09 Mon Sep 17 00:00:00 2001 From: weiyi Date: Thu, 21 Oct 2021 10:04:21 +1100 Subject: [PATCH] Fix "undefined" username and sync variable errors Various playbooks were failing with undefined-variable errors. - All playbooks had typos of `bigip_user` instead of `bigip_username`. - http01 validation hook was not passing device-sync-related variables to `deploy_challenge` and `clean_challenge` playbooks. --- etc/dehydrated/ansible/hooks/bigip-traffic-http-01.sh | 4 ++-- etc/dehydrated/ansible/playbooks/bigip-clean_challenge.yml | 2 +- .../ansible/playbooks/bigip-configure-acme-http-01.yml | 2 +- .../playbooks/bigip-configure-lets-encrypt-ocsp-stapling.yml | 2 +- .../ansible/playbooks/bigip-deploy_cert-management.yml | 2 +- .../ansible/playbooks/bigip-deploy_cert-traffic.yml | 2 +- etc/dehydrated/ansible/playbooks/bigip-deploy_challenge.yml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/etc/dehydrated/ansible/hooks/bigip-traffic-http-01.sh b/etc/dehydrated/ansible/hooks/bigip-traffic-http-01.sh index 967ae51..d381e1e 100644 --- a/etc/dehydrated/ansible/hooks/bigip-traffic-http-01.sh +++ b/etc/dehydrated/ansible/hooks/bigip-traffic-http-01.sh @@ -20,7 +20,7 @@ deploy_challenge() { ansible-playbook ${ANSIBLE_ARGS} \ --inventory=${ANSIBLE_INVENTORY} \ - --extra-vars "bigip_partition=${BIGIP_PARTITION} data_group_name=${BIGIP_DATA_GROUP_NAME} key_name=${TOKEN_FILENAME} key_value=${TOKEN_VALUE} ${ANSIBLE_EXTRA_VARS}" \ + --extra-vars "bigip_partition=${BIGIP_PARTITION} data_group_name=${BIGIP_DATA_GROUP_NAME} key_name=${TOKEN_FILENAME} key_value=${TOKEN_VALUE} sync_config=${BIGIP_SYNC_CONFIG} sync_device_group=${BIGIP_SYNC_DEVICE_GROUP} ${ANSIBLE_EXTRA_VARS}" \ ${ANSIBLE_PLAYBOOK_DEPLOY_CHALLENGE} return ${?} @@ -35,7 +35,7 @@ clean_challenge() { ansible-playbook ${ANSIBLE_ARGS} \ --inventory=${ANSIBLE_INVENTORY} \ - --extra-vars "bigip_partition=${BIGIP_PARTITION} data_group_name=${BIGIP_DATA_GROUP_NAME} key_name=${TOKEN_FILENAME} key_value=${TOKEN_VALUE} ${ANSIBLE_EXTRA_VARS}" \ + --extra-vars "bigip_partition=${BIGIP_PARTITION} data_group_name=${BIGIP_DATA_GROUP_NAME} key_name=${TOKEN_FILENAME} key_value=${TOKEN_VALUE} sync_config=${BIGIP_SYNC_CONFIG} sync_device_group=${BIGIP_SYNC_DEVICE_GROUP} ${ANSIBLE_EXTRA_VARS}" \ ${ANSIBLE_PLAYBOOK_CLEAN_CHALLENGE} return ${?} diff --git a/etc/dehydrated/ansible/playbooks/bigip-clean_challenge.yml b/etc/dehydrated/ansible/playbooks/bigip-clean_challenge.yml index ed6c2b5..2391b74 100644 --- a/etc/dehydrated/ansible/playbooks/bigip-clean_challenge.yml +++ b/etc/dehydrated/ansible/playbooks/bigip-clean_challenge.yml @@ -30,7 +30,7 @@ bigip_device_info: gather_subset: devices provider: - user: "{{ bigip_user }}" + user: "{{ bigip_username }}" password: "{{ bigip_password }}" server: "{{ inventory_hostname }}" validate_certs: no diff --git a/etc/dehydrated/ansible/playbooks/bigip-configure-acme-http-01.yml b/etc/dehydrated/ansible/playbooks/bigip-configure-acme-http-01.yml index 14a36b9..95b2b41 100644 --- a/etc/dehydrated/ansible/playbooks/bigip-configure-acme-http-01.yml +++ b/etc/dehydrated/ansible/playbooks/bigip-configure-acme-http-01.yml @@ -29,7 +29,7 @@ bigip_device_info: gather_subset: devices provider: - user: "{{ bigip_user }}" + user: "{{ bigip_username }}" password: "{{ bigip_password }}" server: "{{ inventory_hostname }}" validate_certs: no diff --git a/etc/dehydrated/ansible/playbooks/bigip-configure-lets-encrypt-ocsp-stapling.yml b/etc/dehydrated/ansible/playbooks/bigip-configure-lets-encrypt-ocsp-stapling.yml index 2783d8b..f84404b 100644 --- a/etc/dehydrated/ansible/playbooks/bigip-configure-lets-encrypt-ocsp-stapling.yml +++ b/etc/dehydrated/ansible/playbooks/bigip-configure-lets-encrypt-ocsp-stapling.yml @@ -29,7 +29,7 @@ bigip_device_info: gather_subset: devices provider: - user: "{{ bigip_user }}" + user: "{{ bigip_username }}" password: "{{ bigip_password }}" server: "{{ inventory_hostname }}" validate_certs: no diff --git a/etc/dehydrated/ansible/playbooks/bigip-deploy_cert-management.yml b/etc/dehydrated/ansible/playbooks/bigip-deploy_cert-management.yml index 3d582be..b036506 100644 --- a/etc/dehydrated/ansible/playbooks/bigip-deploy_cert-management.yml +++ b/etc/dehydrated/ansible/playbooks/bigip-deploy_cert-management.yml @@ -14,7 +14,7 @@ bigip_device_info: gather_subset: devices provider: - user: "{{ bigip_user }}" + user: "{{ bigip_username }}" password: "{{ bigip_password }}" server: "{{ inventory_hostname }}" validate_certs: no diff --git a/etc/dehydrated/ansible/playbooks/bigip-deploy_cert-traffic.yml b/etc/dehydrated/ansible/playbooks/bigip-deploy_cert-traffic.yml index 17ab5f1..22fab98 100644 --- a/etc/dehydrated/ansible/playbooks/bigip-deploy_cert-traffic.yml +++ b/etc/dehydrated/ansible/playbooks/bigip-deploy_cert-traffic.yml @@ -29,7 +29,7 @@ bigip_device_info: gather_subset: devices provider: - user: "{{ bigip_user }}" + user: "{{ bigip_username }}" password: "{{ bigip_password }}" server: "{{ inventory_hostname }}" validate_certs: no diff --git a/etc/dehydrated/ansible/playbooks/bigip-deploy_challenge.yml b/etc/dehydrated/ansible/playbooks/bigip-deploy_challenge.yml index 31a892b..da90029 100644 --- a/etc/dehydrated/ansible/playbooks/bigip-deploy_challenge.yml +++ b/etc/dehydrated/ansible/playbooks/bigip-deploy_challenge.yml @@ -29,7 +29,7 @@ bigip_device_info: gather_subset: devices provider: - user: "{{ bigip_user }}" + user: "{{ bigip_username }}" password: "{{ bigip_password }}" server: "{{ inventory_hostname }}" validate_certs: no