Let's jump right into examining the roles we created.
The completed role and file named main.yml
located in the
cloud-infra-check/tasks
directory looks similar to this:
--- - name: Create working directory shell: mkdir {{ REPORT_DIR }} ignore_errors: yes - name: Copy the Infrastructure services check script template: src=infra_check.sh dest={{ DEPLOY_LOC }} mode=0755 - name: Add report header shell: ( echo "+------------------------------------+"; echo "| {{ COMPANY }} Cloud Health Check |"; echo "| Created at {{ lookup('pipe', 'date +%Y-%m-%d%t%X') }} |"; echo "+------------------------------------+"; echo " ";) >> {{ REPORT_DIR }}/os_health_check_{{ lookup('pipe', 'date +%Y%m%d') }}.txt - name: Execute Infrastructure services check script shell: "'{{ DEPLOY_LOC }}/infra_check.sh' {{ REPORT_DIR }}"
The completed role and file named main.yml
located in the cloud-core-os-check/tasks
directory is as shown:
--- - name: Create working directory shell: mkdir...