Dick Visser
unread,Jul 15, 2020, 10:04:54 AM7/15/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
Hi
As part of our deployment we are saving a file
/etc/deployment_status.json onto remote nodes:
vars:
deployment_status:
version: "{{ our_version }}"
date: "{{ ansible_date_time.iso8601 }}"
deployer: "{{ lookup('env', 'USER') }}"
ansible: "{{ lookup('pipe', 'ansible --version') }}"
pre_tasks:
- name: Write deployment status to /etc/deployment_status.json
copy:
content: "{{ deployment_status | to_nice_json }}"
dest: /etc/deployment_status.json
tags: always,deployment_status
This has proven to be helpful.
Now I would like to also include information about how
ansible-playbook was invoked, for instance which tags were used, or
what hosts the deployment was limited to.
Is there any way of knowing what arguments ansible-playbook was run
with, from within ansible?
thx!
--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT