lxc: Add /etc of lxc containers to git
This commit is contained in:
parent
a387304483
commit
a82ae51008
|
@ -16,6 +16,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
|
|||
* haproxy: add haproxy_allow_ip_nonlocal_bind to set sysctl value (optional)
|
||||
* kvm-host: fix depreciation of "drbd-overview" by "drbdadm status" in add-vm.sh
|
||||
* openvpn: configure logrotate
|
||||
* lxc: Add /etc of containers in git
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
|
@ -45,8 +45,10 @@
|
|||
- name: "Some entries MUST be in the {{ repository_path }}/.gitignore file"
|
||||
lineinfile:
|
||||
dest: "{{ repository_path }}/.gitignore"
|
||||
line: "{{ item }}"
|
||||
line: "{{ gitignore_line }}"
|
||||
loop: "{{ gitignore_items | default([]) }}"
|
||||
loop_control:
|
||||
loop_var: gitignore_line
|
||||
tags:
|
||||
- etc-git
|
||||
|
||||
|
|
1
lxc/files/gitignore
Symbolic link
1
lxc/files/gitignore
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../etc-git/files/gitignore
|
|
@ -52,6 +52,22 @@
|
|||
insertbefore: "^exit 0$"
|
||||
when: release == 'jessie'
|
||||
|
||||
# For some reason import_role/include_role doesn't work here.
|
||||
# Apparently ansible see some condition that end up being false.
|
||||
# So we use import_tasks and a symlink.
|
||||
- name: "Put /etc of container {{ name }} into git"
|
||||
import_tasks: repository.yml
|
||||
vars:
|
||||
repository_path: "/var/lib/lxc/{{ name }}/rootfs/etc"
|
||||
gitignore_items:
|
||||
- "aliases.db"
|
||||
- "*.swp"
|
||||
- "postfix/sa-blacklist.access"
|
||||
- "postfix/*.db"
|
||||
- "postfix/spamd.cidr"
|
||||
- "evobackup/.keep-*"
|
||||
- "letsencrypt/.certbot.lock"
|
||||
|
||||
- name: "Ensure that {{ name }} container is running"
|
||||
lxc_container:
|
||||
name: "{{ name }}"
|
||||
|
|
|
@ -52,6 +52,8 @@
|
|||
- name: Create containers
|
||||
include: create-container.yml
|
||||
vars:
|
||||
name: "{{ item.name }}"
|
||||
release: "{{ item.release }}"
|
||||
name: "{{ container.name }}"
|
||||
release: "{{ container.release }}"
|
||||
loop: "{{ lxc_containers }}"
|
||||
loop_control:
|
||||
loop_var: container
|
||||
|
|
1
lxc/tasks/repository.yml
Symbolic link
1
lxc/tasks/repository.yml
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../etc-git/tasks/repository.yml
|
Loading…
Reference in a new issue