Ansible playbook fails when .ansible/tmp directory path changes
up vote
0
down vote
favorite
Essentially, what is going on here is that the user account that ansible is running under is present on both the control node, and the target client.
However, on the target client, as part of the server remediation process, one of the steps is to change where the home directory of that account lives from /home/voltron/ to /opt/home/voltron/ (No, the account can't be created using that directory on server creation sadly.)
The problem in doing this with ansible is that it "loses access" to it's working tmp directory in ~/.ansible/tmp on the target client (in this case the server t-rex). This causes the playbook to fail out on any following play with the following error message:
fatal: [t-rex]: UNREACHABLE! => {"changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: ( umask 77 && mkdir -p "` echo /home/volton/.ansible/tmp/ansible-tmp-1507231978.66-123682989430617 `" && echo ansible-tmp-1507231978.66-123682989430617="` echo /home/volton/.ansible/tmp/ansible-tmp-1507231978.66-123682989430617 `" ), exited with result 1", "unreachable": true}
Now, all I need to do is somehow tell ansible that it's working directory on the target client has changed locations during the playbook run by having it re-gather facts, but that does not seem to help. (At least the way I am doing it)
I have tried to immediately call the setup module in the play after the one that changes the location of the ansible account's (voltron) working temp directory, and it "seems" to run, but then when the next "import_playbook" statement is read, the failure described above occurs, a failure is given, and the entire thing blows up forcing me to potentially re-run a fairly long playbook. Obviously, this following run does work because ansible's facts now know that it's working directory has changed.
Anyone have any ideas on how I would inform ansible when it's working temp directory location changes? Let me know, thanks!
linux ansible
add a comment |
up vote
0
down vote
favorite
Essentially, what is going on here is that the user account that ansible is running under is present on both the control node, and the target client.
However, on the target client, as part of the server remediation process, one of the steps is to change where the home directory of that account lives from /home/voltron/ to /opt/home/voltron/ (No, the account can't be created using that directory on server creation sadly.)
The problem in doing this with ansible is that it "loses access" to it's working tmp directory in ~/.ansible/tmp on the target client (in this case the server t-rex). This causes the playbook to fail out on any following play with the following error message:
fatal: [t-rex]: UNREACHABLE! => {"changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: ( umask 77 && mkdir -p "` echo /home/volton/.ansible/tmp/ansible-tmp-1507231978.66-123682989430617 `" && echo ansible-tmp-1507231978.66-123682989430617="` echo /home/volton/.ansible/tmp/ansible-tmp-1507231978.66-123682989430617 `" ), exited with result 1", "unreachable": true}
Now, all I need to do is somehow tell ansible that it's working directory on the target client has changed locations during the playbook run by having it re-gather facts, but that does not seem to help. (At least the way I am doing it)
I have tried to immediately call the setup module in the play after the one that changes the location of the ansible account's (voltron) working temp directory, and it "seems" to run, but then when the next "import_playbook" statement is read, the failure described above occurs, a failure is given, and the entire thing blows up forcing me to potentially re-run a fairly long playbook. Obviously, this following run does work because ansible's facts now know that it's working directory has changed.
Anyone have any ideas on how I would inform ansible when it's working temp directory location changes? Let me know, thanks!
linux ansible
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Essentially, what is going on here is that the user account that ansible is running under is present on both the control node, and the target client.
However, on the target client, as part of the server remediation process, one of the steps is to change where the home directory of that account lives from /home/voltron/ to /opt/home/voltron/ (No, the account can't be created using that directory on server creation sadly.)
The problem in doing this with ansible is that it "loses access" to it's working tmp directory in ~/.ansible/tmp on the target client (in this case the server t-rex). This causes the playbook to fail out on any following play with the following error message:
fatal: [t-rex]: UNREACHABLE! => {"changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: ( umask 77 && mkdir -p "` echo /home/volton/.ansible/tmp/ansible-tmp-1507231978.66-123682989430617 `" && echo ansible-tmp-1507231978.66-123682989430617="` echo /home/volton/.ansible/tmp/ansible-tmp-1507231978.66-123682989430617 `" ), exited with result 1", "unreachable": true}
Now, all I need to do is somehow tell ansible that it's working directory on the target client has changed locations during the playbook run by having it re-gather facts, but that does not seem to help. (At least the way I am doing it)
I have tried to immediately call the setup module in the play after the one that changes the location of the ansible account's (voltron) working temp directory, and it "seems" to run, but then when the next "import_playbook" statement is read, the failure described above occurs, a failure is given, and the entire thing blows up forcing me to potentially re-run a fairly long playbook. Obviously, this following run does work because ansible's facts now know that it's working directory has changed.
Anyone have any ideas on how I would inform ansible when it's working temp directory location changes? Let me know, thanks!
linux ansible
Essentially, what is going on here is that the user account that ansible is running under is present on both the control node, and the target client.
However, on the target client, as part of the server remediation process, one of the steps is to change where the home directory of that account lives from /home/voltron/ to /opt/home/voltron/ (No, the account can't be created using that directory on server creation sadly.)
The problem in doing this with ansible is that it "loses access" to it's working tmp directory in ~/.ansible/tmp on the target client (in this case the server t-rex). This causes the playbook to fail out on any following play with the following error message:
fatal: [t-rex]: UNREACHABLE! => {"changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: ( umask 77 && mkdir -p "` echo /home/volton/.ansible/tmp/ansible-tmp-1507231978.66-123682989430617 `" && echo ansible-tmp-1507231978.66-123682989430617="` echo /home/volton/.ansible/tmp/ansible-tmp-1507231978.66-123682989430617 `" ), exited with result 1", "unreachable": true}
Now, all I need to do is somehow tell ansible that it's working directory on the target client has changed locations during the playbook run by having it re-gather facts, but that does not seem to help. (At least the way I am doing it)
I have tried to immediately call the setup module in the play after the one that changes the location of the ansible account's (voltron) working temp directory, and it "seems" to run, but then when the next "import_playbook" statement is read, the failure described above occurs, a failure is given, and the entire thing blows up forcing me to potentially re-run a fairly long playbook. Obviously, this following run does work because ansible's facts now know that it's working directory has changed.
Anyone have any ideas on how I would inform ansible when it's working temp directory location changes? Let me know, thanks!
linux ansible
linux ansible
asked Mar 8 at 16:03
Viscosity
79111
79111
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Why not change the tmp directory ansible uses? E.g. in ansible.cfg
set something like
remote_tmp = /var/tmp/notfiddledwithduringtheplay
which may then need to be created as part of a bootstrap process, or you could risk using some common tmp
directory, or ...
There's also a local_tmp
directory in the event you're instead fiddling around with things on the local system.
So you're basically saying I should mess around with the ansible.cfg file to account for this. Could work, but am I able to specify "rollover" working tmp directories to ensure this doesn't happen? I was also hoping something from within a playbook could solve it as well.
– Viscosity
Mar 8 at 16:38
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Why not change the tmp directory ansible uses? E.g. in ansible.cfg
set something like
remote_tmp = /var/tmp/notfiddledwithduringtheplay
which may then need to be created as part of a bootstrap process, or you could risk using some common tmp
directory, or ...
There's also a local_tmp
directory in the event you're instead fiddling around with things on the local system.
So you're basically saying I should mess around with the ansible.cfg file to account for this. Could work, but am I able to specify "rollover" working tmp directories to ensure this doesn't happen? I was also hoping something from within a playbook could solve it as well.
– Viscosity
Mar 8 at 16:38
add a comment |
up vote
0
down vote
Why not change the tmp directory ansible uses? E.g. in ansible.cfg
set something like
remote_tmp = /var/tmp/notfiddledwithduringtheplay
which may then need to be created as part of a bootstrap process, or you could risk using some common tmp
directory, or ...
There's also a local_tmp
directory in the event you're instead fiddling around with things on the local system.
So you're basically saying I should mess around with the ansible.cfg file to account for this. Could work, but am I able to specify "rollover" working tmp directories to ensure this doesn't happen? I was also hoping something from within a playbook could solve it as well.
– Viscosity
Mar 8 at 16:38
add a comment |
up vote
0
down vote
up vote
0
down vote
Why not change the tmp directory ansible uses? E.g. in ansible.cfg
set something like
remote_tmp = /var/tmp/notfiddledwithduringtheplay
which may then need to be created as part of a bootstrap process, or you could risk using some common tmp
directory, or ...
There's also a local_tmp
directory in the event you're instead fiddling around with things on the local system.
Why not change the tmp directory ansible uses? E.g. in ansible.cfg
set something like
remote_tmp = /var/tmp/notfiddledwithduringtheplay
which may then need to be created as part of a bootstrap process, or you could risk using some common tmp
directory, or ...
There's also a local_tmp
directory in the event you're instead fiddling around with things on the local system.
answered Mar 8 at 16:23
thrig
23.7k12955
23.7k12955
So you're basically saying I should mess around with the ansible.cfg file to account for this. Could work, but am I able to specify "rollover" working tmp directories to ensure this doesn't happen? I was also hoping something from within a playbook could solve it as well.
– Viscosity
Mar 8 at 16:38
add a comment |
So you're basically saying I should mess around with the ansible.cfg file to account for this. Could work, but am I able to specify "rollover" working tmp directories to ensure this doesn't happen? I was also hoping something from within a playbook could solve it as well.
– Viscosity
Mar 8 at 16:38
So you're basically saying I should mess around with the ansible.cfg file to account for this. Could work, but am I able to specify "rollover" working tmp directories to ensure this doesn't happen? I was also hoping something from within a playbook could solve it as well.
– Viscosity
Mar 8 at 16:38
So you're basically saying I should mess around with the ansible.cfg file to account for this. Could work, but am I able to specify "rollover" working tmp directories to ensure this doesn't happen? I was also hoping something from within a playbook could solve it as well.
– Viscosity
Mar 8 at 16:38
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f429055%2fansible-playbook-fails-when-ansible-tmp-directory-path-changes%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown