You could put those steps in pre_tasks instead of tasks.
On Friday, August 21, 2015 at 9:13:18 AM UTC-4, Sebastien Hadjifotis wrote:
>
> ---
> # file: cmservers.yml
> - hosts:cmservers
> vars:
> users_default_password: "{{ password_hash.stdout }}"
> tasks:
> - include_vars: /var/cm/local/ansible/vault/myservers
> - local_action: "command openssl passwd -salt '{{
> cm_default_password_salt }}' -1 '{{ cm_default_password }}'"
> register: password_hash
> changed_when: False
> - debug: var=password_hash
> roles:
> - ansible-users-master
>
>
>
> TASK: [ansible-users-master | Create users]
> ***********************************
> ok: [miluvl162] => (item={'comment': 'Some User', 'state': 'present',
> 'group': 'primgroup', 'name': 'user1', 'groups': ['extragroup'],
> 'is_admin': False, 'uid': 20001})
>
> TASK: [ansible-users-master | Add admin users to admin group]
> *****************
> skipping: [miluvl162] => (item={'comment': 'Some User', 'state':
> 'present', 'group': 'primgroup', 'name': 'user1', 'groups': ['extragroup'],
> 'is_admin': False, 'uid': 20001})
>
> TASK: [ansible-users-master | Remove group]
> ***********************************
> skipping: [miluvl162] => (item={'gid': 29999, 'name': 'primgroup'})
> skipping: [miluvl162] => (item={'gid': 39999, 'name': 'extragroup'})
>
> TASK: [ansible-users-master | Remove per-user groups]
> *************************
> skipping: [miluvl162] => (item={'comment': 'Some User', 'state':
> 'present', 'group': 'primgroup', 'name': 'user1', 'groups': ['extragroup'],
> 'is_admin': False, 'uid': 20001})
>
> TASK: [ansible-users-master | SSH keys]
> ***************************************
> skipping: [miluvl162]
>
> TASK: [ansible-users-master | Sudo installed]
> *********************************
> ok: [miluvl162]
>
> TASK: [ansible-users-master | Admin sudoers]
> **********************************
> skipping: [miluvl162]
>
> TASK: [include_vars /var/cm/local/ansible/vault/cmservers]
> ********************
> ok: [miluvl162]
>
> TASK: [command openssl passwd -salt '{{ cm_default_password_salt }}' -1
> '{{ cm_default_password }}'] ***
> ok: [miluvl162 -> 127.0.0.1]
>
> How do I get the local_action executed first?
>
>
--
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/90c85403-55aa-441e-b704-02e5282c8114%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.