ansible-community / ara-web

Stateless web client for the ARA Records Ansible API.
https://ara.recordsansible.org
GNU General Public License v3.0
37 stars 8 forks source link

Playbooks with the --check argument enabled should be highlighted as such #6

Open dmsimard opened 5 years ago

dmsimard commented 5 years ago

When running an ansible-playbook command with the --check argument, it is essentially a dry run and should probably be identified as such in the web client.

I don't have a strong opinion on whether it should be a different color, a different icon or something else at this time.

We can tell if --check was enabled under playbook["arguments"]["check"], for example:

{
    "id": 1,
    "arguments": {
        "verbosity": 3,
        "inventory": [
            "/etc/ansible/hosts"
        ],
        "listhosts": null,
        "subset": null,
        "module_path": null,
        "extra_vars": "Not saved by ARA as configured by 'ignored_arguments'",
        "forks": 5,
        "ask_vault_pass": false,
        "vault_password_files": [],
        "vault_ids": [],
        "tags": [
            "all"
        ],
        "skip_tags": [],
        "ask_pass": false,
        "private_key_file": null,
        "remote_user": null,
        "connection": "smart",
        "timeout": 10,
        "ssh_common_args": "",
        "sftp_extra_args": "",
        "scp_extra_args": "",
        "ssh_extra_args": "",
        "sudo": false,
        "sudo_user": null,
        "su": false,
        "su_user": null,
        "become": false,
        "become_method": "sudo",
        "become_user": "root",
        "ask_sudo_pass": false,
        "ask_su_pass": false,
        "become_ask_pass": false,
        "check": false,      <--- Here
        "syntax": null,
        "diff": false,
        "force_handlers": false,
        "flush_cache": null,
        "listtasks": null,
        "listtags": null,
        "step": null,
        "start_at_task": null
    },
}
dmsimard commented 5 years ago

Note: alpha4 doesn't provide the arguments on a playbook list (/api/v1/playbooks), only in a playbook detail (/api/v1/playbooks/1). I'll take care of it in https://github.com/ansible-community/ara/issues/28