f5alliances / ansible-use-cases-101

1 stars 2 forks source link

Exercise 2.2, running the answer yml template but got errors #24

Open gavinw2006 opened 4 years ago

gavinw2006 commented 4 years ago

https://github.com/f5alliances/ansible-use-cases-101/blob/master/2.2-error-handling/bigip-error-handling.yml

image

gavinw2006 commented 4 years ago

copy/paste the yml file from the lab manual, got the "automap1" doesn't exist error, change it to "automap", no errors, but seems it doesn't use pool variable : {{pool_name}}, instead use the real pool name: http_pool, not sure it is working and right template for other pool.

image

payalsin commented 4 years ago

@gavinw2006 - the intent is to show rollback so Automap1 is intentional. The rollback must have failed because the nodes might be used by another pool, can you run the playbook at https://raw.githubusercontent.com/f5alliances/ansible-use-cases-101/master/2.2-error-handling/bigip-error-handling.yml in verbose mode

ansible-playbook bigip-error-handling.yml -vvvv

If you change it to Automap it will not go into the rollback code.

gavinw2006 commented 4 years ago

right, understood. cheers for the comments Payal!

gavinw2006 commented 4 years ago

@payalsin , it works as expected.

image

gavinw2006 commented 4 years ago

[student1@ansible ~]$ ansible-playbook bigip-error-handling-payal.yml -vvvv ansible-playbook 2.7.10 config file = /home/student1/.ansible.cfg configured module search path = [u'/home/student1/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /usr/bin/ansible-playbook python version = 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] Using /home/student1/.ansible.cfg as config file setting up inventory plugins /home/student1/networking-workshop/lab_inventory/hosts did not meet host_list requirements, check plugin documentation if this is unexpected /home/student1/networking-workshop/lab_inventory/hosts did not meet script requirements, check plugin documentation if this is unexpected Parsed /home/student1/networking-workshop/lab_inventory/hosts inventory source with ini plugin Loading callback plugin yaml of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/yaml.pyc

PLAYBOOK: bigip-error-handling-payal.yml **** 1 plays in bigip-error-handling-payal.yml

PLAY [BIG-IP SETUP] ***** META: ran handlers

TASK [Setup provider] *** task path: /home/student1/bigip-error-handling-payal.yml:12 ok: [f5] => changed=false ansible_facts: provider: password: ansible server: 172.16.113.86 server_port: '8443' user: admin validate_certs: 'no'

TASK [CREATE NODES] ***** task path: /home/student1/bigip-error-handling-payal.yml:23 <34.218.205.182> connection transport is rest <34.218.205.182> ESTABLISH LOCAL CONNECTION FOR USER: student1 <34.218.205.182> EXEC /bin/sh -c 'echo ~student1 && sleep 0' <34.218.205.182> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/student1/.ansible/tmp/ansible-tmp-1575455112.73-109418821684576" && echo ansible-tmp-1575455112.73-109418821684576="echo /home/student1/.ansible/tmp/ansible-tmp-1575455112.73-109418821684576" ) && sleep 0' Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_node.py <34.218.205.182> PUT /home/student1/.ansible/tmp/ansible-local-32181w2Wwm0/tmp0FEzWd TO /home/student1/.ansible/tmp/ansible-tmp-1575455112.73-109418821684576/AnsiballZ_bigip_node.py <34.218.205.182> EXEC /bin/sh -c 'chmod u+x /home/student1/.ansible/tmp/ansible-tmp-1575455112.73-109418821684576/ /home/student1/.ansible/tmp/ansible-tmp-1575455112.73-109418821684576/AnsiballZ_bigip_node.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c '/usr/bin/python /home/student1/.ansible/tmp/ansible-tmp-1575455112.73-109418821684576/AnsiballZ_bigip_node.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c 'rm -f -r /home/student1/.ansible/tmp/ansible-tmp-1575455112.73-109418821684576/ > /dev/null 2>&1 && sleep 0' changed: [f5] => (item=host1) => changed=true fqdn: autopopulate: enabled downInterval: '5' interval: '3600' fqdn_address_type: ipv4 fqdn_auto_populate: enabled fqdn_down_interval: '5' fqdn_up_interval: '3600' invocation: module_args: address: 34.213.63.163 auth_provider: null connection_limit: null description: null dynamic_ratio: null fqdn: null fqdn_address_type: null fqdn_auto_populate: null fqdn_down_interval: null fqdn_up_interval: null host: 34.213.63.163 monitor_type: null monitors: null name: host1 partition: Common password: null provider: auth_provider: null password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER server: 172.16.113.86 server_port: 8443 ssh_keyfile: null timeout: null transport: rest user: admin validate_certs: false quorum: null rate_limit: null ratio: null server: null server_port: null state: present transport: null user: null validate_certs: null item: host1 ratio: 1 session: user-enabled state: user-up <34.218.205.182> connection transport is rest <34.218.205.182> EXEC /bin/sh -c 'echo ~student1 && sleep 0' <34.218.205.182> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/student1/.ansible/tmp/ansible-tmp-1575455113.57-214677775952208" && echo ansible-tmp-1575455113.57-214677775952208="echo /home/student1/.ansible/tmp/ansible-tmp-1575455113.57-214677775952208" ) && sleep 0' Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_node.py <34.218.205.182> PUT /home/student1/.ansible/tmp/ansible-local-32181w2Wwm0/tmpSISSdQ TO /home/student1/.ansible/tmp/ansible-tmp-1575455113.57-214677775952208/AnsiballZ_bigip_node.py <34.218.205.182> EXEC /bin/sh -c 'chmod u+x /home/student1/.ansible/tmp/ansible-tmp-1575455113.57-214677775952208/ /home/student1/.ansible/tmp/ansible-tmp-1575455113.57-214677775952208/AnsiballZ_bigip_node.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c '/usr/bin/python /home/student1/.ansible/tmp/ansible-tmp-1575455113.57-214677775952208/AnsiballZ_bigip_node.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c 'rm -f -r /home/student1/.ansible/tmp/ansible-tmp-1575455113.57-214677775952208/ > /dev/null 2>&1 && sleep 0' changed: [f5] => (item=host2) => changed=true fqdn: autopopulate: enabled downInterval: '5' interval: '3600' fqdn_address_type: ipv4 fqdn_auto_populate: enabled fqdn_down_interval: '5' fqdn_up_interval: '3600' invocation: module_args: address: 52.26.160.15 auth_provider: null connection_limit: null description: null dynamic_ratio: null fqdn: null fqdn_address_type: null fqdn_auto_populate: null fqdn_down_interval: null fqdn_up_interval: null host: 52.26.160.15 monitor_type: null monitors: null name: host2 partition: Common password: null provider: auth_provider: null password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER server: 172.16.113.86 server_port: 8443 ssh_keyfile: null timeout: null transport: rest user: admin validate_certs: false quorum: null rate_limit: null ratio: null server: null server_port: null state: present transport: null user: null validate_certs: null item: host2 ratio: 1 session: user-enabled state: user-up

TASK [CREATE POOL] ** task path: /home/student1/bigip-error-handling-payal.yml:30 <34.218.205.182> connection transport is rest <34.218.205.182> ESTABLISH LOCAL CONNECTION FOR USER: student1 <34.218.205.182> EXEC /bin/sh -c 'echo ~student1 && sleep 0' <34.218.205.182> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/student1/.ansible/tmp/ansible-tmp-1575455114.12-122153691419243" && echo ansible-tmp-1575455114.12-122153691419243="echo /home/student1/.ansible/tmp/ansible-tmp-1575455114.12-122153691419243" ) && sleep 0' Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.py <34.218.205.182> PUT /home/student1/.ansible/tmp/ansible-local-32181w2Wwm0/tmpYacSNj TO /home/student1/.ansible/tmp/ansible-tmp-1575455114.12-122153691419243/AnsiballZ_bigip_pool.py <34.218.205.182> EXEC /bin/sh -c 'chmod u+x /home/student1/.ansible/tmp/ansible-tmp-1575455114.12-122153691419243/ /home/student1/.ansible/tmp/ansible-tmp-1575455114.12-122153691419243/AnsiballZ_bigip_pool.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c '/usr/bin/python /home/student1/.ansible/tmp/ansible-tmp-1575455114.12-122153691419243/AnsiballZ_bigip_pool.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c 'rm -f -r /home/student1/.ansible/tmp/ansible-tmp-1575455114.12-122153691419243/ > /dev/null 2>&1 && sleep 0' changed: [f5] => changed=true invocation: module_args: auth_provider: null description: null lb_method: round-robin metadata: null monitor_type: and_list monitors:

TASK [ADD POOL MEMBERS] ***** task path: /home/student1/bigip-error-handling-payal.yml:38 <34.218.205.182> connection transport is rest <34.218.205.182> ESTABLISH LOCAL CONNECTION FOR USER: student1 <34.218.205.182> EXEC /bin/sh -c 'echo ~student1 && sleep 0' <34.218.205.182> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/student1/.ansible/tmp/ansible-tmp-1575455114.9-43280437210236" && echo ansible-tmp-1575455114.9-43280437210236="echo /home/student1/.ansible/tmp/ansible-tmp-1575455114.9-43280437210236" ) && sleep 0' Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.py <34.218.205.182> PUT /home/student1/.ansible/tmp/ansible-local-32181w2Wwm0/tmpcrtpAV TO /home/student1/.ansible/tmp/ansible-tmp-1575455114.9-43280437210236/AnsiballZ_bigip_pool_member.py <34.218.205.182> EXEC /bin/sh -c 'chmod u+x /home/student1/.ansible/tmp/ansible-tmp-1575455114.9-43280437210236/ /home/student1/.ansible/tmp/ansible-tmp-1575455114.9-43280437210236/AnsiballZ_bigip_pool_member.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c '/usr/bin/python /home/student1/.ansible/tmp/ansible-tmp-1575455114.9-43280437210236/AnsiballZ_bigip_pool_member.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c 'rm -f -r /home/student1/.ansible/tmp/ansible-tmp-1575455114.9-43280437210236/ > /dev/null 2>&1 && sleep 0' changed: [f5] => (item=host1) => changed=true address: 34.213.63.163 fqdn_auto_populate: false invocation: module_args: address: 34.213.63.163 auth_provider: null connection_limit: null description: null fqdn: null fqdn_auto_populate: null host: 34.213.63.163 name: host1 partition: Common password: null pool: test_http_pool port: 80 preserve_node: null priority_group: null provider: auth_provider: null password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER server: 172.16.113.86 server_port: 8443 ssh_keyfile: null timeout: null transport: rest user: admin validate_certs: false rate_limit: null ratio: null reuse_nodes: true server: null server_port: null state: present transport: null user: null validate_certs: null item: host1 session: user-enabled state: present <34.218.205.182> connection transport is rest <34.218.205.182> EXEC /bin/sh -c 'echo ~student1 && sleep 0' <34.218.205.182> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/student1/.ansible/tmp/ansible-tmp-1575455115.74-68296384095749" && echo ansible-tmp-1575455115.74-68296384095749="echo /home/student1/.ansible/tmp/ansible-tmp-1575455115.74-68296384095749" ) && sleep 0' Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.py <34.218.205.182> PUT /home/student1/.ansible/tmp/ansible-local-32181w2Wwm0/tmpwAuBKK TO /home/student1/.ansible/tmp/ansible-tmp-1575455115.74-68296384095749/AnsiballZ_bigip_pool_member.py <34.218.205.182> EXEC /bin/sh -c 'chmod u+x /home/student1/.ansible/tmp/ansible-tmp-1575455115.74-68296384095749/ /home/student1/.ansible/tmp/ansible-tmp-1575455115.74-68296384095749/AnsiballZ_bigip_pool_member.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c '/usr/bin/python /home/student1/.ansible/tmp/ansible-tmp-1575455115.74-68296384095749/AnsiballZ_bigip_pool_member.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c 'rm -f -r /home/student1/.ansible/tmp/ansible-tmp-1575455115.74-68296384095749/ > /dev/null 2>&1 && sleep 0' changed: [f5] => (item=host2) => changed=true address: 52.26.160.15 fqdn_auto_populate: false invocation: module_args: address: 52.26.160.15 auth_provider: null connection_limit: null description: null fqdn: null fqdn_auto_populate: null host: 52.26.160.15 name: host2 partition: Common password: null pool: test_http_pool port: 80 preserve_node: null priority_group: null provider: auth_provider: null password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER server: 172.16.113.86 server_port: 8443 ssh_keyfile: null timeout: null transport: rest user: admin validate_certs: false rate_limit: null ratio: null reuse_nodes: true server: null server_port: null state: present transport: null user: null validate_certs: null item: host2 session: user-enabled state: present

TASK [ADD VIRTUAL SERVER] *** task path: /home/student1/bigip-error-handling-payal.yml:48 <34.218.205.182> connection transport is rest <34.218.205.182> ESTABLISH LOCAL CONNECTION FOR USER: student1 <34.218.205.182> EXEC /bin/sh -c 'echo ~student1 && sleep 0' <34.218.205.182> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/student1/.ansible/tmp/ansible-tmp-1575455116.31-41992030972078" && echo ansible-tmp-1575455116.31-41992030972078="echo /home/student1/.ansible/tmp/ansible-tmp-1575455116.31-41992030972078" ) && sleep 0' Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.py <34.218.205.182> PUT /home/student1/.ansible/tmp/ansible-local-32181w2Wwm0/tmpiAQ0iG TO /home/student1/.ansible/tmp/ansible-tmp-1575455116.31-41992030972078/AnsiballZ_bigip_virtual_server.py <34.218.205.182> EXEC /bin/sh -c 'chmod u+x /home/student1/.ansible/tmp/ansible-tmp-1575455116.31-41992030972078/ /home/student1/.ansible/tmp/ansible-tmp-1575455116.31-41992030972078/AnsiballZ_bigip_virtual_server.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c '/usr/bin/python /home/student1/.ansible/tmp/ansible-tmp-1575455116.31-41992030972078/AnsiballZ_bigip_virtual_server.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c 'rm -f -r /home/student1/.ansible/tmp/ansible-tmp-1575455116.31-41992030972078/ > /dev/null 2>&1 && sleep 0' changed: [f5] => changed=true address_translation: false destination: 172.16.113.86 invocation: module_args: address_translation: null all_profiles:

TASK [SAVE RUNNING CONFIGURATION] *** task path: /home/student1/bigip-error-handling-payal.yml:80 <34.218.205.182> connection transport is rest <34.218.205.182> ESTABLISH LOCAL CONNECTION FOR USER: student1 <34.218.205.182> EXEC /bin/sh -c 'echo ~student1 && sleep 0' <34.218.205.182> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/student1/.ansible/tmp/ansible-tmp-1575455117.37-79192701942669" && echo ansible-tmp-1575455117.37-79192701942669="echo /home/student1/.ansible/tmp/ansible-tmp-1575455117.37-79192701942669" ) && sleep 0' Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.py <34.218.205.182> PUT /home/student1/.ansible/tmp/ansible-local-32181w2Wwm0/tmpDrahZV TO /home/student1/.ansible/tmp/ansible-tmp-1575455117.37-79192701942669/AnsiballZ_bigip_config.py <34.218.205.182> EXEC /bin/sh -c 'chmod u+x /home/student1/.ansible/tmp/ansible-tmp-1575455117.37-79192701942669/ /home/student1/.ansible/tmp/ansible-tmp-1575455117.37-79192701942669/AnsiballZ_bigip_config.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c '/usr/bin/python /home/student1/.ansible/tmp/ansible-tmp-1575455117.37-79192701942669/AnsiballZ_bigip_config.py && sleep 0' <34.218.205.182> EXEC /bin/sh -c 'rm -f -r /home/student1/.ansible/tmp/ansible-tmp-1575455117.37-79192701942669/ > /dev/null 2>&1 && sleep 0' changed: [f5] => changed=true invocation: module_args: auth_provider: null merge_content: null password: null provider: auth_provider: null password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER server: 172.16.113.86 server_port: 8443 ssh_keyfile: null timeout: null transport: rest user: admin validate_certs: false reset: false save: true server: null server_port: null transport: null user: null validate_certs: null verify: false stdout:

PLAY RECAP ** f5 : ok=6 changed=5 unreachable=0 failed=0

[student1@ansible ~]$