reset.yml - Ubuntu Bionic does not support networking service restart.

BUG REPORT: Bionic does not support networking service restart. It is replaced by systemd-networkd.

Environment:

  • On Premise:

  • OS (printf "$(uname -srm)\n$(cat /etc/os-release)\n"):

Linux 4.15.0-20-generic x86_64
NAME="Ubuntu"
VERSION="18.04 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
  • Version of Ansible (ansible --version):
ansible 2.6.4
  config file = /Users/ltupin/git/infrastructure/installation/exoscale/infra-prod-kube/ansible/ansible.cfg
  configured module search path = ['/Users/ltupin/git/infrastructure/installation/exoscale/infra-prod-kube/ansible/library']
  ansible python module location = /usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.0 (default, Dec 24 2016, 08:01:42) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]

Kubespray version (commit) (git rev-parse --short HEAD):

66e304c4

Network plugin used: calico

Copy of your inventory file: not relevant

Command used to invoke ansible:

ansible-playbook -i ${inventory} reset.yml -vv

Output of ansible run:

fatal: [<my_servers>]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "daemon_reload": false,
            "enabled": null,
            "force": null,
            "masked": null,
            "name": "networking",
            "no_block": false,
            "state": "restarted",
            "user": false
        }
    },
    "msg": "Could not find the requested service networking: host"
}

Anything else do we need to know: Solution: By adding a condition for "Bionic" in reset | Restart network step.