]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Fixed a couple bugs with ansible user creation.
authorAndrew Schoen <aschoen@redhat.com>
Tue, 21 Apr 2015 16:25:02 +0000 (11:25 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 21 Apr 2015 20:32:13 +0000 (15:32 -0500)
We need to delete the users password after creation or ansible fails to
connect with the cm user because the node is asking for a password.

Also, the lineinfile making sure #includedir was present wasn't working
correctly.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/ansible-managed/tasks/main.yml

index 08a7ad6ae51a5f1086139b0fc1976934e39ab6a5..3ebd889d79c78a5184f963c12d40e720d2552ced 100644 (file)
@@ -8,13 +8,17 @@
   user:
     name: "{{ ansible_user }}"
     group: sudo
+    update_password: on_create
+  register: user_created
+
+- name: Delete the ansible users password.
+  command: "passwd -d {{ ansible_user }}"
+  when: user_created is defined and user_created|changed
 
 - name: Ensure includedir is present in sudoers.
   lineinfile:
     dest: /etc/sudoers
     line: "#includedir /etc/sudoers.d"
-    regexp: "#includedir /etc/sudoers.d"
-    backrefs: yes
     state: present
     validate: visudo -cf %s