Closed sxpert closed 7 years ago
@sxpert Did you try it without setting ifupdown_ignore_cap12s
and ifupdown_ignore_static
?
if I do that, nothing happens, all is skipped
TASK [debops.ifupdown : include] ***********************************************
task path: /etc/ansible/roles/debops.ifupdown/tasks/main.yml:4
skipping: [jmmc-ctrl-1] => {"changed": false, "skip_reason": "Conditional check failed", "skipped": true}
TASK [debops.ifupdown : Create directory] **************************************
task path: /etc/ansible/roles/debops.ifupdown/tasks/main.yml:7
skipping: [jmmc-ctrl-1] => (item={u'path': u'/etc/network/interfaces.d'}) => {"changed": false, "item": {"path": "/etc/network/interfaces.d"}, "skip_reason": "Conditional check failed", "skipped": true}
skipping: [jmmc-ctrl-1] => (item={u'path': u'/etc/network/interfaces.config.d'}) => {"changed": false, "item": {"path": "/etc/network/interfaces.config.d"}, "skip_reason": "Conditional check failed", "skipped": true}
TASK [debops.ifupdown : include] ***********************************************
task path: /etc/ansible/roles/debops.ifupdown/tasks/main.yml:19
skipping: [jmmc-ctrl-1] => {"changed": false, "skip_reason": "Conditional check failed", "skipped": true}
TASK [debops.ifupdown : include] ***********************************************
task path: /etc/ansible/roles/debops.ifupdown/tasks/main.yml:22
skipping: [jmmc-ctrl-1] => {"changed": false, "skip_reason": "Conditional check failed", "skipped": true}
TASK [debops.ifupdown : include] ***********************************************
task path: /etc/ansible/roles/debops.ifupdown/tasks/main.yml:25
skipping: [jmmc-ctrl-1] => {"changed": false, "skip_reason": "Conditional check failed", "skipped": true}
TASK [debops.ifupdown : include] ***********************************************
task path: /etc/ansible/roles/debops.ifupdown/tasks/main.yml:28
included: /etc/ansible/roles/debops.ifupdown/tasks/revert_interfaces.yml for jmmc-ctrl-1
TASK [debops.ifupdown : Move interfaces out of the way before reversion] *******
task path: /etc/ansible/roles/debops.ifupdown/tasks/revert_interfaces.yml:3
<10.11.0.5> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.11.0.5> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/home/sxpert/.ansible/cp/ansible-ssh-%h-%p-%r -tt 10.11.0.5 '/bin/sh -c '"'"'( umask 22 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1456824988.73-170800470595563 `" && echo "` echo $HOME/.ansible/tmp/ansible-tmp-1456824988.73-170800470595563 `" )'"'"''
<10.11.0.5> PUT /tmp/tmp9zgpFJ TO /home/ansible/.ansible/tmp/ansible-tmp-1456824988.73-170800470595563/command
<10.11.0.5> SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/home/sxpert/.ansible/cp/ansible-ssh-%h-%p-%r '[10.11.0.5]'
<10.11.0.5> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.11.0.5> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/home/sxpert/.ansible/cp/ansible-ssh-%h-%p-%r -tt 10.11.0.5 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-nppnkefxailnqvpxnoldernzaiuqnkhg; /bin/sh -c '"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1456824988.73-170800470595563/command; rm -rf "/home/ansible/.ansible/tmp/ansible-tmp-1456824988.73-170800470595563/" > /dev/null 2>&1'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"''"'"'"'"'"'"'"'"''"'"''
ok: [jmmc-ctrl-1] => {"changed": false, "cmd": "rm -f /etc/network/interfaces", "invocation": {"module_args": {"_raw_params": "rm -f /etc/network/interfaces", "_uses_shell": false, "chdir": null, "creates": null, "executable": null, "removes": "/etc/network/interfaces.dpkg-divert", "warn": true}, "module_name": "command"}, "rc": 0, "stderr": false, "stdout": "skipped, since /etc/network/interfaces.dpkg-divert does not exist", "stdout_lines": ["skipped, since /etc/network/interfaces.dpkg-divert does not exist"]}
TASK [debops.ifupdown : Revert original /etc/network/interfaces] ***************
task path: /etc/ansible/roles/debops.ifupdown/tasks/revert_interfaces.yml:6
<10.11.0.5> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.11.0.5> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/home/sxpert/.ansible/cp/ansible-ssh-%h-%p-%r -tt 10.11.0.5 '/bin/sh -c '"'"'( umask 22 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1456824988.86-169964816586425 `" && echo "` echo $HOME/.ansible/tmp/ansible-tmp-1456824988.86-169964816586425 `" )'"'"''
<10.11.0.5> PUT /tmp/tmp7uRKmy TO /home/ansible/.ansible/tmp/ansible-tmp-1456824988.86-169964816586425/command
<10.11.0.5> SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/home/sxpert/.ansible/cp/ansible-ssh-%h-%p-%r '[10.11.0.5]'
<10.11.0.5> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.11.0.5> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/home/sxpert/.ansible/cp/ansible-ssh-%h-%p-%r -tt 10.11.0.5 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-dfhfflqiwbkvssxrspesxovzendkhcsu; /bin/sh -c '"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1456824988.86-169964816586425/command; rm -rf "/home/ansible/.ansible/tmp/ansible-tmp-1456824988.86-169964816586425/" > /dev/null 2>&1'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"''"'"'"'"'"'"'"'"''"'"''
ok: [jmmc-ctrl-1] => {"changed": false, "cmd": "dpkg-divert --quiet --local --rename --remove /etc/network/interfaces", "invocation": {"module_args": {"_raw_params": "dpkg-divert --quiet --local --rename --remove /etc/network/interfaces", "_uses_shell": false, "chdir": null, "creates": null, "executable": null, "removes": "/etc/network/interfaces.dpkg-divert", "warn": true}, "module_name": "command"}, "rc": 0, "stderr": false, "stdout": "skipped, since /etc/network/interfaces.dpkg-divert does not exist", "stdout_lines": ["skipped, since /etc/network/interfaces.dpkg-divert does not exist"]}
OK, so what's the configuration like? Is that a VM, a container, hardware? What does the default /etc/network/interfaces
have? Is this system using systemd
or other init?
The interface configuration process is designed roughly like this:
/etc/network/interfaces.config.d/
, remembering which interfaces "changed". If it's a first time, move the old /etc/network/interfaces
to /etc/network/interfaces.d/interfaces.old
so that ifupdown
scripts know about the current interface configuration.;ifdown
. If it's a first time, stop all interfaces. This should have killed the dhclient
you mentioned./etc/network/interfaces.d/
with contents of /etc/network/interfaces.config.d/
. This should destroy the interfaces.old
file so it doesn't interfere.ifup
or it's systemd
equivalent.So, in other words, dhclient
should have been killed automatically by ifupdown
scripts. But it depends on the initial configuration.
Did you try configuring that host with DebOps without any config, just for testing?
the system is a qemu/kvm vm, running ubuntu 14.04 minimal setup, the install is pxe-booted. initially /etc/network/interfaces contains :
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
manually running ifdown eth0
indeed removes the dhclient process
what do you mean in the last question ?
@sxpert Do you try to use the debops.ifupdown
role on its own in your custom setup, or do you use full DebOps playbook to configure the system?
This configuration should be handled without issue (dangling dhclient
), and without the two ignore variables set.
yes, I use debops.ifupdown by itself. I guess I could look into using debops.bootstrap, considering lots of the work I did does the same thing ;-) (I only recently discovered debops) If I remove the 2 ignore variable, then ifupdown does nothing
@sxpert So, what ifupdown_*
variables do you have set? Check the main.yml
file, there is a set of conditions, without any variables set it should automatically detect the environment and run different configurations according to it. Is Network Manager installed, since that's Ubuntu?
Add a bunch of debug
tasks and check all the variables included in when
conditions, check which one makes the conditions not valid.
no, I don't have network manager. not touching that one with a 10m pole on a server ;-) will try
here's what I have in syslog:
syslog:Mar 1 11:22:02 jmmc-ctrl-1 ifupdown-reconfigure-interfaces: Interface state: removed=// generated=/eth0 eth1/ auto=/eth0 eth1/ hotplug=/eth0 eth1/ start=/eth0 eth1/ list=/eth0 eth1/
syslog:Mar 1 11:22:02 jmmc-ctrl-1 ifupdown-reconfigure-interfaces: Stopping networking service
syslog:Mar 1 11:22:02 jmmc-ctrl-1 ifupdown-reconfigure-interfaces: Starting up eth0 interface
syslog:Mar 1 11:22:02 jmmc-ctrl-1 ifupdown-reconfigure-interfaces: Starting up eth1 interface
Yup, so as I just explained above, script stops all networking (the first time) and starts up interfaces separately. Not sure why that dhclient
stays there.
Can you try with Debian Stable instead? See if it works there? It has systemd
, so it should "take care" of that dhclient
better than sysvinit
.
start point is pxe-installed ubuntu with eth0 configured with dhcp when configuring the following
this process is left dangling :
it should probably be killed by the bash script