Merge "Cleanup mounts in containers"
This commit is contained in:
commit
4383396ba3
@ -33,7 +33,10 @@ nspawn_read_only_host_bindmount: "{{ _nspawn_read_only_host_bindmount | default(
|
|||||||
# bind mount. If any of these items are passed into the container.
|
# bind mount. If any of these items are passed into the container.
|
||||||
# nspawn_shared_host_bindmount:
|
# nspawn_shared_host_bindmount:
|
||||||
# - /etc/apt
|
# - /etc/apt
|
||||||
nspawn_shared_host_bindmount: "{{ _nspawn_shared_host_bindmount | default([]) }}"
|
nspawn_shared_host_bindmount:
|
||||||
|
- /etc/localtime
|
||||||
|
- /root
|
||||||
|
- /opt
|
||||||
|
|
||||||
# Defined CPU architecture map
|
# Defined CPU architecture map
|
||||||
nspawn_architecture_mapping:
|
nspawn_architecture_mapping:
|
||||||
@ -84,12 +87,18 @@ container_image: "{{ nspawn_map['distro'] }}-{{ nspawn_map['release'] }}-{{ nspa
|
|||||||
container_domain: "openstack.local"
|
container_domain: "openstack.local"
|
||||||
|
|
||||||
# Container Default bind mounts. This option will be merged with the container
|
# Container Default bind mounts. This option will be merged with the container
|
||||||
# bind mounts. This option takes a list of files on a host that will be mounted
|
# bind mounts. This option takes a list of files with `mount_path` defining the
|
||||||
# at the exact same path within the container.
|
# path on the host and `bind_dir_path` which defines the intra-container path
|
||||||
container_default_bind_mounts: []
|
# and is relative, it assumes that it starts with a "/".
|
||||||
|
container_default_bind_mounts:
|
||||||
|
- mount_path: "/openstack/backup/{{ inventory_hostname }}"
|
||||||
|
bind_dir_path: "var/backup"
|
||||||
|
|
||||||
# Container bind mounts. This option takes a list of files on a host that will
|
# Container bind mounts. This option takes a list of files on a host that will
|
||||||
# be mounted at the exact same path within the container.
|
# be mounted at the exact same path within the container. This option takes a
|
||||||
|
# list of files with `mount_path` defining the path on the host and
|
||||||
|
# `bind_dir_path` which defines the intra-container path which is a relative
|
||||||
|
# and starts at "/".
|
||||||
container_bind_mounts: []
|
container_bind_mounts: []
|
||||||
|
|
||||||
# option used to specific specific container config values which will be
|
# option used to specific specific container config values which will be
|
||||||
|
@ -353,7 +353,6 @@
|
|||||||
name: systemd_networkd
|
name: systemd_networkd
|
||||||
private: true
|
private: true
|
||||||
vars:
|
vars:
|
||||||
systemd_interface_cleanup: true
|
|
||||||
systemd_run_networkd: true
|
systemd_run_networkd: true
|
||||||
systemd_resolved_available: "{{ nspawn_container_enable_resolved }}"
|
systemd_resolved_available: "{{ nspawn_container_enable_resolved }}"
|
||||||
systemd_resolved:
|
systemd_resolved:
|
||||||
|
@ -16,7 +16,7 @@ BindReadOnly={{ ro_bind.source }}:{{ ro_bind.dest }}
|
|||||||
Bind=/openstack/backup/{{ inventory_hostname }}:/var/backup
|
Bind=/openstack/backup/{{ inventory_hostname }}:/var/backup
|
||||||
Bind=/openstack/log/{{ inventory_hostname }}:/var/log
|
Bind=/openstack/log/{{ inventory_hostname }}:/var/log
|
||||||
{% for bind in container_default_bind_mounts | union(container_bind_mounts | default([])) %}
|
{% for bind in container_default_bind_mounts | union(container_bind_mounts | default([])) %}
|
||||||
Bind={{ bind.mount_path }}:{{ bind.bind_dir_path }}
|
Bind={{ bind.mount_path }}:/{{ bind.bind_dir_path }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for bind in nspawn_shared_host_bindmount %}
|
{% for bind in nspawn_shared_host_bindmount %}
|
||||||
Bind={{ bind }}:{{ bind }}
|
Bind={{ bind }}:{{ bind }}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
{% set _ = cli_switches.append('--bind=/openstack/backup/' + inventory_hostname + ':/var/backup') %}
|
{% set _ = cli_switches.append('--bind=/openstack/backup/' + inventory_hostname + ':/var/backup') %}
|
||||||
{% set _ = cli_switches.append('--bind=/openstack/log/' + inventory_hostname + ':/var/log') %}
|
{% set _ = cli_switches.append('--bind=/openstack/log/' + inventory_hostname + ':/var/log') %}
|
||||||
{% for bind in container_default_bind_mounts | union(container_bind_mounts | default([])) %}
|
{% for bind in container_default_bind_mounts | union(container_bind_mounts | default([])) %}
|
||||||
{% set _ = cli_switches.append('--bind=' + bind.mount_path + ':' + bind.bind_dir_path) %}
|
{% set _ = cli_switches.append('--bind=' + bind.mount_path + ':/' + bind.bind_dir_path) %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for bind in nspawn_shared_host_bindmount %}
|
{% for bind in nspawn_shared_host_bindmount %}
|
||||||
{% set _ = cli_switches.append('--bind=' + bind + ':' + bind) %}
|
{% set _ = cli_switches.append('--bind=' + bind + ':' + bind) %}
|
||||||
|
@ -17,17 +17,3 @@ _nspawn_map:
|
|||||||
distro: centos
|
distro: centos
|
||||||
arch: "{{ nspawn_architecture_mapping[container_architecture] }}"
|
arch: "{{ nspawn_architecture_mapping[container_architecture] }}"
|
||||||
release: 7
|
release: 7
|
||||||
|
|
||||||
# This is a list of items that will be passed into the container as READ-ONLY
|
|
||||||
# files or directories. If any of these items are passed into the container
|
|
||||||
# the container create process will ensure the file is not present within the
|
|
||||||
# contianer prior to writting the config.
|
|
||||||
_nspawn_read_only_host_bindmount:
|
|
||||||
- { source: /etc/environment, dest: /etc/environment }
|
|
||||||
|
|
||||||
# This is a list of items that will be passed into the container as a shared
|
|
||||||
# bind mount. If any of these items are passed into the container.
|
|
||||||
_nspawn_shared_host_bindmount:
|
|
||||||
- /etc/localtime
|
|
||||||
- /root
|
|
||||||
- /opt
|
|
||||||
|
@ -18,20 +18,6 @@ _nspawn_map:
|
|||||||
arch: "{{ nspawn_architecture_mapping[container_architecture] }}"
|
arch: "{{ nspawn_architecture_mapping[container_architecture] }}"
|
||||||
release: "{{ hostvars[physical_host]['ansible_distribution_version'] }}"
|
release: "{{ hostvars[physical_host]['ansible_distribution_version'] }}"
|
||||||
|
|
||||||
# This is a list of items that will be passed into the container as READ-ONLY
|
|
||||||
# files or directories. If any of these items are passed into the container
|
|
||||||
# the container create process will ensure the file is not present within the
|
|
||||||
# contianer prior to writting the config.
|
|
||||||
_nspawn_read_only_host_bindmount:
|
|
||||||
- { source: /etc/environment, dest: /etc/environment }
|
|
||||||
|
|
||||||
# This is a list of items that will be passed into the container as a shared
|
|
||||||
# bind mount. If any of these items are passed into the container.
|
|
||||||
_nspawn_shared_host_bindmount:
|
|
||||||
- /etc/localtime
|
|
||||||
- /root
|
|
||||||
- /opt
|
|
||||||
|
|
||||||
# This version of SUSE does not have access to systemd-resolved. This will need
|
# This version of SUSE does not have access to systemd-resolved. This will need
|
||||||
# to remained disabled until it does.
|
# to remained disabled until it does.
|
||||||
_nspawn_container_enable_resolved: false
|
_nspawn_container_enable_resolved: false
|
||||||
|
@ -17,17 +17,3 @@ _nspawn_map:
|
|||||||
distro: ubuntu
|
distro: ubuntu
|
||||||
arch: "{{ nspawn_architecture_mapping[container_architecture] }}"
|
arch: "{{ nspawn_architecture_mapping[container_architecture] }}"
|
||||||
release: xenial
|
release: xenial
|
||||||
|
|
||||||
# This is a list of items that will be passed into the container as READ-ONLY
|
|
||||||
# files or directories. If any of these items are passed into the container
|
|
||||||
# the container create process will ensure the file is not present within the
|
|
||||||
# contianer prior to writting the config.
|
|
||||||
_nspawn_read_only_host_bindmount:
|
|
||||||
- { source: /etc/environment, dest: /etc/environment }
|
|
||||||
|
|
||||||
# This is a list of items that will be passed into the container as a shared
|
|
||||||
# bind mount. If any of these items are passed into the container.
|
|
||||||
_nspawn_shared_host_bindmount:
|
|
||||||
- /etc/localtime
|
|
||||||
- /root
|
|
||||||
- /opt
|
|
||||||
|
@ -17,17 +17,3 @@ _nspawn_map:
|
|||||||
distro: ubuntu
|
distro: ubuntu
|
||||||
arch: "{{ nspawn_architecture_mapping[container_architecture] }}"
|
arch: "{{ nspawn_architecture_mapping[container_architecture] }}"
|
||||||
release: bionic
|
release: bionic
|
||||||
|
|
||||||
# This is a list of items that will be passed into the container as READ-ONLY
|
|
||||||
# files or directories. If any of these items are passed into the container
|
|
||||||
# the container create process will ensure the file is not present within the
|
|
||||||
# contianer prior to writting the config.
|
|
||||||
_nspawn_read_only_host_bindmount:
|
|
||||||
- { source: /etc/environment, dest: /etc/environment }
|
|
||||||
|
|
||||||
# This is a list of items that will be passed into the container as a shared
|
|
||||||
# bind mount. If any of these items are passed into the container.
|
|
||||||
_nspawn_shared_host_bindmount:
|
|
||||||
- /etc/localtime
|
|
||||||
- /root
|
|
||||||
- /opt
|
|
||||||
|
Loading…
Reference in New Issue
Block a user