From add653a260aa3ec99829709c554374146d874a21 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Mon, 24 Oct 2022 12:22:57 +0300 Subject: [PATCH] add debug --- tasks/configure.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index a61780f..cea7606 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -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']"