I am running a playbook that adds a subdirectory on the Ansible Tower host (defined as a group of Servers with one entry) for every userid name in a variables list. I have integrated the variables and inventories from an existing command line playbook into Ansible Tower.
This is the start of playbook
---
- name: SSH Key file location
hosts: tower_host
become: yes
tasks:
- name: Flag for working indicator
file:
path: /usr/local/ssh_lib/zaphod
state: directory
mode: 0777
- name: Make sure SSH Library directory exists
file:
state: directory
mode: 0777
with_items: '{{ user_add_ssh }}'
when: usingjumphost is defined and usingjumphost == true
- name: User management SSH - generate ssh keys
This is the results
SSH password:
SUDO password[defaults to SSH password]:
PLAY [SSH Key file location] ***************************************************
PLAY [User management SSH - generate ssh keys] *********************************
So, it skips both the tasks completely. I create a second playbook WITH! THE! EXACT! SAME! TEXT! and this is what happens,...
PLAY [SSH Key file location] ***************************************************
TASK [Flag for working indicator] **********************************************
changed: [nextgen-ansible]
TASK [Make sure SSH Library directory exists] **********************************
changed: [nextgen-ansible] => (item={u'comment': u'trixie la belle', u'ssh_key_bits': 2048, u'update_password': u'on_create', u'group': u'sysadmin', u'uid': 1200, u'environments': [u'Prod'], u'ssh_key_file': u'.ssh/id_rsa', u'groups': [u'astro', u'burle'], u'generate_ssh_key': True, u'password': u'$6$rounds=100000$4EFEJzJJbsVutV4P$LellqXZWfsyHCJh8ts/jkd8wySfGk1YDH6ZYphmx1aD4NJXb8KVND/ZEUFsuZzc65KJ9Yw94k5H8TOGldxQ1n0', u'ssh_key_type': u'rsa', u'append': True, u'name': u'trixie1'})
changed: [nextgen-ansible] => (item={u'comment': u'baxter morgan', u'ssh_key_bits': 2048, u'update_password': u'on_create', u'group': u'sysadmin', u'uid': 1204, u'environments': [u'all'], u'ssh_key_file': u'.ssh/id_rsa', u'generate_ssh_key': True, u'password': u'$6$rounds=100000$4EFEJzJJbsVutV4P$LellqXZWfsyHCJh8ts/jkd8wySfGk1YDH6ZYphmx1aD4NJXb8KVND/ZEUFsuZzc65KJ9Yw94k5H8TOGldxQ1n0', u'ssh_key_type': u'rsa', u'append': True, u'name': u'baxter5'})
So, what is different? Inventories are the same, OS file permissions are the same, Variables are the same, EVERYTHING ELSE IS THE SAME!. Unless Ansible can behave consistently or fail loudly when something is wrongly formatted, it's useless to me and my customers as a deployment tool.