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!