[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: how to run ansible-playbook in a container on origin 3.9



Hi Marc,

From the logs, it clearly says its a permission issue,
either use a Persistence Volume for the directories where writes are supposed to happen
or change permissions to write in those directories Since Openshift runs containers using an arbitrarily assigned user ID.

ref: https://stackoverflow.com/a/42366425/2804654

regards,
sgk

On Thu, Jun 21, 2018 at 10:18 AM, Marc Boorshtein <mboorshtein gmail com> wrote:
I created a simple container on centos7 designed to run an ansible playbook.  Runs great on local docker, but in openshift I get permission denied errors.  I added ANSIBLE_LOCAL_TMP=/tmp as an environment variable but I'm still getting the error that local directories can't be created:

fatal: [node.local.lan]: FAILED! => {
    "msg": "Unable to create local directories(/.ansible/cp): [Errno 13] Permission denied: '/.ansible'"
}

here's the entire output
ansible-playbook 2.5.5
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
Using /etc/ansible/ansible.cfg as config file
Parsed /etc/secrets/hosts inventory source with ini plugin
PLAYBOOK: push-keytabs.yaml ****************************************************
1 plays in /etc/config/push-keytabs.yaml
PLAY [openshift-nodes] *********************************************************
TASK [Gathering Facts] *********************************************************
task path: /etc/config/push-keytabs.yaml:2
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
<node.local.lan> ESTABLISH SSH CONNECTION FOR USER: sa-kt-deployment
fatal: [node.local.lan]: FAILED! => {
    "msg": "Unable to create local directories(/.ansible/cp): [Errno 13] Permission denied: '/.ansible'"
}
PLAY RECAP *********************************************************************
node.local.lan           : ok=0    changed=0    unreachable=0    failed=1
 [WARNING]: Could not create retry file '/etc/config/push-keytabs.retry'.
[Errno 30] Read-only file system: u'/etc/config/push-keytabs.retry'

Is there another variable i need to set?

Thanks
Marc

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]