add debug

This commit is contained in:
Antonio J. Delgado 2022-10-24 12:22:57 +03:00
parent 4254d8675a
commit add653a260

View file

@ -33,6 +33,12 @@
- not puppet_agent.stat.exists
- puppet_script.stdout == ''
- name: Show puppet_script
debug:
msg: "{{ puppet_script }}"
when:
- not puppet_agent.stat.exists
- name: Check puppet agent was found
assert:
that:
@ -48,8 +54,17 @@
when:
- not puppet_agent.stat.exists
- name: Link agent to /usr/local/bin
file:
state: link
dest: /usr/local/bin/puppet
src: "{{ puppet_agent_cmd }}"
when:
- puppet_agent_cmd != '/usr/local/bin/puppet'
- name: Obtain puppet configuration directory
shell: "{{ puppet_agent_cmd }} config print confdir"
shell: "/usr/local/bin/puppet config print confdir"
register: current_puppet_confdir
- name: Ensure puppet server is configured in main section
@ -113,7 +128,7 @@
mode: 0644
- name: Run puppet for the first time
shell: "{{ puppet_agent_cmd }} agent -t"
shell: "/usr/local/bin/puppet agent -t"
when: run_puppet
- name: Ensure puppet agent service is enabled and started
@ -127,6 +142,6 @@
- name: Ensure puppet agent cron exists (WSL only)
cron:
name: puppet agent
job: "{{ puppet_agent_cmd }} agent -t"
job: "/usr/local/bin/puppet agent -t"
minute: '30'
when: "'WSL' in ansible_facts['kernel']"