Standard Method (no library)The arguments are stored in process.argvHere are the node docs on handling command line args:process.argv is an…
With ansible 2.7 you can do this:
$ cd /path/to/ansible/
$ ansible localhost -m include_role -a name=<role_name>
localhost | SUCCESS => {
"changed": false,
"include_variables": {
"name": "<role_name>"
}
}
localhost | SUCCESS => {
"msg": "<role_name>"
}
This will run role from /path/to/ansible/roles or configured role path.
Read more here: https://github.com/ansible/ansible/pull/43131