I define a custom ansible.cfg, and export it as below in the
export ANSIBLE_CONFIG="../aws_ansible.cfg"
when I run it, this is picked up but when I pass the inventory as an arg, it fails to recognize the arg or take precedence although there is no inventory specified in the aws_ansible.cfg
.
export ANSIBLE_CONFIG=../aws_ansible.cfg
ansible-playbook demo.yml -i ./inventories/dev1 --verbose
Using /projects/demo/aws_ansible.cfg as config file
If I specify the inventory within aws_ansible.cfg
it would work, but I would like to pass it as an argument.
Please advice if also extra-vars
would take precedence over what are specified in aws_ansible.cfg
aws_ansible.cfg
looks as below
[defaults]
; strategy_plugins = ../mitogen/ansible_mitogen/plugins/strategy
private_key_file=~/.ssh/id_rsa
inventory = ./inventories/dev2/hosts
remote_user=ec2-user
host_key_checking = false
filter_plugins = ./filter_plugins
roles_path = ./roles
retry_files_enabled = False
[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=600s -o ControlPath="~/.ansible/cp/ansible-ssh-%h-%p-%r"
pipelining = True