# Solaris 10 - '~' directory created in home directory - unarchive fails

**URL:** <https://forum.ansible.com/t/solaris-10-directory-created-in-home-directory-unarchive-fails/25720>\
**Category:** Ansible Developer\
**Created:** [October 11, 2017, 3:33pm UTC](https://forum.ansible.com/t/solaris-10-directory-created-in-home-directory-unarchive-fails/25720 "2017-10-11T15:33:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmullinnix](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@rmullinnix](https://forum.ansible.com/u/rmullinnix)\
**Post date:** [October 11, 2017, 3:33pm UTC](https://forum.ansible.com/t/solaris-10-directory-created-in-home-directory-unarchive-fails/25720/1 "2017-10-11T15:33:56Z")

</div>

I have set of servers that are Solaris 10. When ansible is invoked against the remote hosts, it creates a ‘~’ directory in the home directory instead of viewing ‘~’ as the users home directory.

xx64473z:apache$ pwd  
/export/home/apache/~/.ansible/tmp  
xx64473z:apache$ ls -l  
total 8  
drwx------ 2 apache staff 512 Oct 11 11:13 ansible-tmp-1507734837.83-37778909106509  
drwx------ 2 apache staff 512 Oct 11 11:14 ansible-tmp-1507734843.04-65780739271966  
drwx------ 2 apache staff 512 Oct 11 11:14 ansible-tmp-1507734843.27-42994154513941  
drwx------ 2 apache staff 512 Oct 11 11:14 ansible-tmp-1507734846.05-28584204910152

The ansible commands run except for unarchive which receives the following error:

fatal: [xx64473z.xx.xxxxxx]: FAILED! =\> {“changed”: false, “failed”: true, “msg”: “Source ‘/export/home/apache/.ansible/tmp/ansible-tmp-1507734843.04-65780739271966/source’ failed to transfer”}

It is looking for the source file in the what should be the default remote\_tmp directory. But since the directory is actually ‘/export/home/apache/~/.ansible/tmp’, it is not able to find the source and fails.

Here is my ansible host version:

ansible 2.3.2.0  
config file = /etc/ansible/ansible.cfg  
configured module search path = Default w/o overrides  
python version = 2.7.5 (default, Aug 29 2016, 10:12:21) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]

And the remove server info:  
“ansible\_distribution”: “Solaris”,  
“ansible\_distribution\_release”: “Oracle Solaris 10 1/13 s10s\_u11wos\_24a SPARC”,  
“ansible\_distribution\_version”: “10”,

I do not know if this is considered a bug. I know I can override the remote\_tmp in the ansible.cfg file, but do not want to make this a global change. Ansible works correctly on all of the other hosts.

Is it possible to set remote\_tmp for a single playbook? Or for a subset of servers?

Any suggestions on how to get around this error?

---

<div class="post-metadata">

**Author:** ![alikins](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@alikins](https://forum.ansible.com/u/alikins)\
**Post date:** [October 12, 2017, 2:26pm UTC](https://forum.ansible.com/t/solaris-10-directory-created-in-home-directory-unarchive-fails/25720/2 "2017-10-12T14:26:19Z")

</div>

Making remote\_tmp finer grained is on the roadmap for 2.5. That includes per host remote\_tmp.

[https://github.com/ansible/ansible/issues/31022](https://github.com/ansible/ansible/issues/31022) is a tracking bug for remote\_tmp related bugs and features which  
are intended to be fixed during 2.5 devel.

[https://github.com/ansible/ansible/issues/20886](https://github.com/ansible/ansible/issues/20886) from that list sounds similar to this issue.

More notes inline below…

> I do not know if this is considered a bug. I know I can override the remote\_tmp in the ansible.cfg file, but do not want to make this a global change. Ansible works correctly on all of the other hosts.

If ~/ is not being evaluated properly that sounds like a bug to me. Could you post an example  
playbook that triggers that? And the output from ansible-playbook with ‘-vvvv’ verbosity for  
a run that does the wrong thing.

Was this working before 2.3.2.0 ? If so, what versions?

Are you able to test against 2.4.0.0 as well? There have been a lot changes to unarchive in 2.4

and some of the file/path handling code that could change the behavior. I don’t see anything  
obvious in the changes that definitely fixes that though.

[https://github.com/ansible/ansible/pull/21874](https://github.com/ansible/ansible/pull/21874) and [https://github.com/ansible/ansible/pull/24732](https://github.com/ansible/ansible/pull/24732)  
and [https://github.com/ansible/ansible/commit/1fb53e6aaf052c34b8715b1f4e9bbe38c3f1c95c](https://github.com/ansible/ansible/commit/1fb53e6aaf052c34b8715b1f4e9bbe38c3f1c95c)

could be candidates though.

---

<div class="post-metadata">

**Author:** ![tkuratom](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@tkuratom](https://forum.ansible.com/u/tkuratom)\
**Post date:** [October 12, 2017, 3:03pm UTC](https://forum.ansible.com/t/solaris-10-directory-created-in-home-directory-unarchive-fails/25720/3 "2017-10-12T15:03:05Z")

</div>

I believe there is a bug for this open[1]\_. If you change remote\_tmp  
to use $HOME instead of ~ I believe that workaround will fix your  
issue on Solaris (but may introduce a problem on platforms where the  
HOME environment variable is not set). The problem ultimately comes  
down to Solaris 10 not shipping with a POSIX compliant /bin/sh. I  
believe some users in the bg report said that they do have a POSIX  
compliant sh in another path so an alternative that would probably  
work would be to set ansible\_shell\_executable pointing to the POSIX  
compatible sh for the Solaris 10 host .

.. \_[1]: [https://github.com/ansible/ansible/issues/21594](https://github.com/ansible/ansible/issues/21594)  
-Toshio

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [October 12, 2017, 3:22pm UTC](https://forum.ansible.com/t/solaris-10-directory-created-in-home-directory-unarchive-fails/25720/4 "2017-10-12T15:22:42Z")

</div>

As mentioned above, we are looking at making all this 'per host  
configurable' in 2.5 so you can alter either shell or remote\_tmp for  
the 'solaris hosts' to avoid this issue. The current default works on  
most platforms and $HOME sadly does not, which is why we are not  
likely to change it.

---

<div class="post-metadata">

**Author:** ![rmullinnix](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@rmullinnix](https://forum.ansible.com/u/rmullinnix)\
**Post date:** [October 12, 2017, 6:11pm UTC](https://forum.ansible.com/t/solaris-10-directory-created-in-home-directory-unarchive-fails/25720/5 "2017-10-12T18:11:02Z")

</div>

I set the remote\_tmp to $HOME and it works for Solaris. My environment is RedHat, Windows, Solaris, AIX and maybe some other stragglers. I haven’t had issues with deploys so far, but have not had the time to test everything. I have bash on the Solaris box, so I may try the ansible\_shell\_executable.

Looking forward to the 2.5 release so I can set it fine grained. These global config changes concern me given the size and growth of our ansible deployment env.

---

<div class="post-metadata">

**Author:** ![tkuratom](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@tkuratom](https://forum.ansible.com/u/tkuratom)\
**Post date:** [October 13, 2017, 2:16pm UTC](https://forum.ansible.com/t/solaris-10-directory-created-in-home-directory-unarchive-fails/25720/6 "2017-10-13T14:16:02Z")

</div>

If ansible\_shell\_executable works you should be able to set it  
per-host (or for a group of hosts). So you will be able to get the  
fine-grained setting you want (it's just not obvious from the symptoms  
that setting the shell is the solution).

-Toshio

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [October 13, 2017, 2:39pm UTC](https://forum.ansible.com/t/solaris-10-directory-created-in-home-directory-unarchive-fails/25720/7 "2017-10-13T14:39:32Z")

</div>

started work on this, it still depends on other parts being there,  
[https://github.com/ansible/ansible/pull/31677](https://github.com/ansible/ansible/pull/31677)

it will make shells and 'remote options' more configurable, including  
tmp of course.

Careful on changing ansible\_shell\_executable, you have to make sure  
ansible\_shell\_type matches.
