diff --git a/tasks/provision.yml b/tasks/provision.yml index 9a19240..9210a01 100644 --- a/tasks/provision.yml +++ b/tasks/provision.yml @@ -1,4 +1,9 @@ --- +- name: check if domain already provisioned + ansible.builtin.stat: + path: /var/lib/samba/private/adsync.conf + register: samba_provisioned + - name: Provision the Samba AD DC ansible.builtin.command: > samba-tool domain provision @@ -10,6 +15,7 @@ --adminpass={{ addc_admin_password }} --option="interfaces=lo eth0" --option="bind interfaces only=yes" + when: not samba_provisioned.stat.exists register: samba_provision_output changed_when: samba_provision_output.rc == 0 no_log: true # You may toggle this if password should be hidden