Can you override location for "cp" folder on remote hosts?

16 views
Skip to first unread message

johhue

unread,
Apr 28, 2016, 11:54:06 AM4/28/16
to Ansible Project
Hello,

Our UNIX administrators are trying to root lock all home directories (/export/home/<user>), including the user which Ansible uses (username: test).

As such, when I send an Ansible command it fails due to the inability to create this "cp" folder under $HOME/.ansible.

I have set remote_tmp to some other directory but this seems to not have anything to do with this "cp" folder.

Is there a way to overrride where this "cp" directory goes?

Note: I am not doing anything with sudo, just basic central host -> remote host connection.

Example:

central:/app/test/ansible> /usr/bin/ansible-playbook -i env.poc playbooks/test_connection.yml -vvv

PLAY [test] *****************************************************************

TASK: [common | check_in] *****************************************************
fatal: [remoteA] => Could not make dir /export/home/test/.ansible/cp: [Errno 13] Permission denied: '/export/home/test/.ansible'
fatal: [remoteB] => Could not make dir /export/home/test/.ansible/cp: [Errno 13] Permission denied: '/export/home/test/.ansible'


Thanks,
John

Andreas Olsson

unread,
Apr 28, 2016, 2:46:34 PM4/28/16
to ansible...@googlegroups.com
On tor, 2016-04-28 at 08:54 -0700, johhue wrote:
....
> Is there a way to overrride where this "cp" directory goes?

Put something like this in your ansible.cfg.

[ssh_connection]
control_path = /path/to/new_cp/ansible-ssh-%%h-%%p-%%r

See also https://docs.ansible.com/ansible/intro_configuration.html#control-path

// Andreas

Johannes Kastl

unread,
Apr 28, 2016, 4:14:13 PM4/28/16
to ansible...@googlegroups.com
You are describing how to use a different control-path, which is on
the host machine, i.e. the machine where ansible is called.

I think John wants to use a different folder on the target host, i.e.
the host on which the changes are applied to...

Johannes

signature.asc

johhue

unread,
Apr 28, 2016, 6:40:21 PM4/28/16
to Ansible Project
Correct! On the remote side.

I tried updating the $HOME environment variable once it goes over there but realized I was down a rat hole and didn't want to break other stuff. 

I saw on a previous post that this is HARD CODED in the Ansible code.

John
Reply all
Reply to author
Forward
0 new messages