From 8a83f475726d4b1c9fc0fba09156a116c32bd68d Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Wed, 29 Jun 2022 09:06:13 +0200 Subject: [PATCH] Redirect error output;Add debugging;Housekeeping --- ansible/roles/appliance/tasks/dependencies.yml | 6 ++++++ .../files/ansible_payload/roles/vapp/tasks/main.yml | 2 ++ ansible/roles/firstboot/templates/firstboot.j2 | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ansible/roles/appliance/tasks/dependencies.yml b/ansible/roles/appliance/tasks/dependencies.yml index 2d9f04f..e3c3d71 100644 --- a/ansible/roles/appliance/tasks/dependencies.yml +++ b/ansible/roles/appliance/tasks/dependencies.yml @@ -27,6 +27,12 @@ cmd: ansible-galaxy collection install {{ item }} loop: "{{ dependencies.ansible_galaxy_collections }}" +- ansible.builtin.command: + cmd: ls ~/.ansible -lashR + register: results +- ansible.builtin.debug: + var: results + - name: Install distro packages ansible.builtin.apt: pkg: "{{ dependencies.packages }}" diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/vapp/tasks/main.yml b/ansible/roles/firstboot/files/ansible_payload/roles/vapp/tasks/main.yml index 803de8e..07615b3 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/vapp/tasks/main.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/vapp/tasks/main.yml @@ -2,6 +2,7 @@ ansible.builtin.shell: cmd: /usr/bin/vmtoolsd --cmd "info-get guestinfo.ovfEnv" register: ovfenv + - name: Parse XML for vApp properties community.general.xml: xmlstring: "{{ ovfenv.stdout }}" @@ -10,6 +11,7 @@ xpath: /ns:Environment/ns:PropertySection/ns:Property content: attribute register: ovfenv + - name: Assign vApp properties to dictionary ansible.builtin.set_fact: vapp: >- diff --git a/ansible/roles/firstboot/templates/firstboot.j2 b/ansible/roles/firstboot/templates/firstboot.j2 index 2e90451..19b5588 100644 --- a/ansible/roles/firstboot/templates/firstboot.j2 +++ b/ansible/roles/firstboot/templates/firstboot.j2 @@ -1,4 +1,4 @@ #!/bin/bash # Apply firstboot configuration w/ ansible -/usr/local/bin/ansible-playbook /opt/firstboot/ansible/playbook.yml | tee -a /var/log/firstboot.log > /dev/tty1 \ No newline at end of file +/usr/local/bin/ansible-playbook /opt/firstboot/ansible/playbook.yml | tee -a /var/log/firstboot.log > /dev/tty1 2>&1