tasks/initscripts: Create /etc/sysconfig/network

The initscripts network service requires /etc/sysconfig/network to be
present. The file might be missing in container images, for example
currently in CentOS 7. It seems to be created by anaconda usually.
Therefore just create it if necessary as it can be empty.

References:
https://bugs.centos.org/view.php?id=16010
This commit is contained in:
Till Maas 2019-04-15 17:35:08 +02:00
parent 25181ed5b7
commit 1b95e02b98

View file

@ -38,6 +38,12 @@
when:
- network_provider == "initscripts"
- name: Ensure initscripts network file dependency is present
copy:
dest: /etc/sysconfig/network
content: "# Created by network system role"
force: false
- name: Configure networking connection profiles
network_connections:
provider: "{{ network_provider | mandatory }}"