Skip to content

Ansible operator is trying to create directory in root instead of home directory. #2839

@abdasgupta

Description

@abdasgupta

In reference to #2812, the issue got solved following @asmacdo suggestion. But I hit another error!

I am trying to install Ripsaw benchmark operator https://github.com/cloud-bulldozer/ripsaw on Power 9 server. When I create the benchmark operator following this guide https://github.com/cloud-bulldozer/ripsaw/blob/master/docs/installation.md, the benchmark operator runs fine. As I am running the setup on Power 9, I had to build docker images for ansible operator https://github.com/operator-framework/operator-sdk and ripsaw benchmark operator https://github.com/cloud-bulldozer/ripsaw/blob/master/build/Dockerfile . But when I tried to deploy a CR using https://github.com/cloud-bulldozer/ripsaw/blob/master/docs/fio_distributed.md , I get the following error in ansible container of benchmark operator:

<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /.ansible/tmp/ansible-tmp-1586856350.6466284-180224553186498 `" && echo ansible-tmp-1586856350.6466284-180224553186498="` echo /.ansible/tmp/ansible-tmp-1586856350.6466284-180224553186498 `" ) && sleep 0'

fatal: [localhost]: 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 target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo /.ansible/tmp/ansible-tmp-1586856350.6466284-180224553186498 `\" && echo ansible-tmp-1586856350.6466284-180224553186498=\"` echo /.ansible/tmp/ansible-tmp-1586856350.6466284-180224553186498 `\" ), exited with result 1, stderr output: mkdir: cannot create directory ‘/.ansible’: Permission denied\n",
    "unreachable": true
}


LAY RECAP *********************************************************************
localhost                  : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0

I checked some codes in ansible-operator. It should try to create .ansible/tmp directory inside ${HOME} where write permission is available. ${HOME} is /opt/ansible. But strangely, it too / as ${HOME} where write permission is available.

My environment:

$cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.1 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.1"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.1 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8.1:GA"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.1
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.1"

$lscpu
Architecture:        ppc64le
Byte Order:          Little Endian
CPU(s):              128
On-line CPU(s) list: 0-127
Thread(s) per core:  4
Core(s) per socket:  16
Socket(s):           2
NUMA node(s):        2
Model:               2.2 (pvr 004e 1202)
Model name:          POWER9, altivec supported
CPU max MHz:         3800.0000
CPU min MHz:         2166.0000
L1d cache:           32K
L1i cache:           32K
L2 cache:            512K
L3 cache:            10240K
NUMA node0 CPU(s):   0-63
NUMA node8 CPU(s):   64-127

cc @asmacdo cc @camilamacedo86 , any suggestion?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions