Hi Teams,
I'm looking for to do a test before to execute a task. I need to checkup if
my computer has already joined the domain
before to join it. otherwise, the adcli will failed.
When computer isn't in domain, the klist will return a "not found" message
and at this time the "join active directory" must be running...
Something goes wrong because this task will not be runned.
Here're the portion of task:
[...]
- name: checking if domain already joined
shell: /bin/bash -c "/usr/bin/klist -k|grep -i {{ ansible_hostname }}"
register: ad_join_status
ignore_errors: true
- name: join active directory
shell: /bin/bash -c "/usr/sbin/realm join --one-time-password={{
ad_server_onetime }} {{ ad_server_domain }}"
register: ad_active
args:
executable: /usr/bin/bash
when: ad_join_status == "not found"
[...]
Do you have any Idea?
Is my test ok or should be another one?
Thanks and best regards, J.
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/2c942264-1f50-4b28-97a3-e640c9fb3c98%40googlegroups.com.