objective:
I want to be able to run a single playbook on a host independent of what 
state its in and only change what's necessary.

problem:
One of the plays in my playbook installs a SW package that disables root 
ssh, so the first thing I do is create an admin user that can execute all 
plays, so when root ssh is disabled all the plays can still work.
However the next time this play is executed ( when the playbook is rerun ) 
the play fails because root ssh is disabled and therefore the playbook 
exits early.

---
- hosts: all
  user: root
  tasks:
    - name: Create an admin account user=cip
      user: name=cip password={{cip_password_hash}} shell=/bin/bash 
group={{admin_group}}

solutions:
What's the best "ansible" way to work around this issue?
1. Put this into a separate playbook and only execute once.
2. Remove the "user: root" from the play and add remote_user: root and 
ignore_errors: yes
3. Something I haven't thought of yet

Any advice would be greatly appreciated. Thanks in advance.

--Brice

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a3bd10e0-7680-4a0d-b127-b3143f6d6d24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to