ARJS Work
ARJS Work

Reputation: 33

Q: ansible; dynamic remote_tmp with inventory_hostname possible in ansible.cfg?

Situation:

Problem:

Question:
Is there a possibility to have a customizable remote_tmp path in ansible.cfg, which is individual for each server, but stays constant during runtime? I want to avoid three seperate ansible.cfg files.

Upvotes: 1

Views: 941

Answers (1)

ARJS Work
ARJS Work

Reputation: 33

Well, after a good night sleep, I tired ansible_remote_tmp in the inventory and it seems to work.

inventory:

...
    t00:
      hosts:
        t00vm1:
            ansible_ssh_common_args: '-F config/ssh.cfg'
            ansible_python_interpreter: python2
            ansible_remote_tmp: /tmp/.ansible.t00vm1
...

Output:

...
TASK [debug] ***********************************************************************************************************
ok: [t00vm1] => {
    "msg": "/tmp/.mqc-ansible.t00vm1"
}
...

Hope that helps others, too.

Upvotes: 1

Related Questions