Gentoo node not emerging package

18 views
Skip to first unread message

Jose Guevarra

unread,
Mar 4, 2015, 12:31:19 AM3/4/15
to ansible...@googlegroups.com

Hi,

I'm trying to have a remote Gentoo node emerge a package but, the control machine states that "ok: [rnce-lcl] => {"changed": false, "msg": "Packages already present."}".  Control machine is ansible 1.8.2 on CentOS7

---

- name: Install syslog-ng
  hosts: rnce-lcl
  remote_user: root
  tasks:
    - portage: package=syslog-ng state=present verbose=yes              


After some searching I attributed this to Genoo having python-3.x installed.  So I then tried setting "ansible_python_interpreter: /usr/bin/python2" in my "all" group inventory file.  Still doesn't work.

On the gentoo node, I used eselect python list to see what default python version it's using. It seems to be using python2.6 by default

Available Python interpreters:
  [1]   python2.6 *
  [2]   python3.1

One thing i noticed after this was doing a "ansible rnce-lcl -m setup -i inventory/"

the "ansible_python_interpreter" variable is not shown. should it be?

It seems that the Gentoo  node is using python2 by default which should work.

Any ideas on what else I can do to get emerging to work?

FULL OUTPUT:



[root@centos7-repo ansible]# ansible-playbook -vvvvv gtoo_service.yml -i inventory/

PLAY [Configuring service] ****************************************************

GATHERING FACTS ***************************************************************
<10.0.1.162> ESTABLISH CONNECTION FOR USER: root
<10.0.1.162> REMOTE_MODULE setup
<10.0.1.162> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 10.0.1.162 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1425063630.46-145933122788716 && echo $HOME/.ansible/tmp/ansible-tmp-1425063630.46-145933122788716'
<10.0.1.162> PUT /tmp/tmpKZ8mDA TO /root/.ansible/tmp/ansible-tmp-1425063630.46-145933122788716/setup
<10.0.1.162> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 10.0.1.162 /bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1425063630.46-145933122788716/setup; rm -rf /root/.ansible/tmp/ansible-tmp-1425063630.46-145933122788716/ >/dev/null 2>&1'
ok: [rnce-lcl]

TASK: [portage package=syslog-ng state=present verbose=yes] *******************
<10.0.1.162> ESTABLISH CONNECTION FOR USER: root
<10.0.1.162> REMOTE_MODULE portage package=syslog-ng state=present verbose=yes
<10.0.1.162> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 10.0.1.162 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1425063631.74-281088121785178 && echo $HOME/.ansible/tmp/ansible-tmp-1425063631.74-281088121785178'
<10.0.1.162> PUT /tmp/tmp4UKrD7 TO /root/.ansible/tmp/ansible-tmp-1425063631.74-281088121785178/portage
<10.0.1.162> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 10.0.1.162 /bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1425063631.74-281088121785178/portage; rm -rf /root/.ansible/tmp/ansible-tmp-1425063631.74-281088121785178/ >/dev/null 2>&1'
ok: [rnce-lcl] => {"changed": false, "msg": "Packages already present."}

PLAY RECAP ********************************************************************
rnce-lcl                   : ok=2    changed=0    unreachable=0    failed=0  




Brian Coca

unread,
Mar 4, 2015, 9:53:58 AM3/4/15
to ansible...@googlegroups.com
so the portage module seems to be detecting the package as installed,
if the python version were incorrect you would be getting a different
error.

also the setup module just shows gathered facts, not inventory variables.

Can you check for the package name with qlist -I?

--
Brian Coca

Jose Guevarra

unread,
Mar 4, 2015, 5:00:12 PM3/4/15
to ansible...@googlegroups.com
There are several things that I noticed

Using the "state" parameter with installed, present, emerged doesn't emerge the package(it states that the package is installed when it's not). However, using the "update=yes" parameter emerges the package (at least in my case).  Although, the "state" parameter can remove packages.

Another confusing behaviour is when doing a dry run/check, ansible comes back with "Packages already present." when it's not.  This should come back with "Package Not Present" and "changed=false".
Reply all
Reply to author
Forward
0 new messages