Compare commits

...

2 commits

Author SHA1 Message Date
Mathieu Trossevin ead025b747
[WIP] Correct putting /etc of container in git being skipped 2022-03-23 16:58:01 +01:00
Mathieu Trossevin 9fbda8d2e1
[WIP] Add /etc of lxc containers to git 2022-03-22 18:05:54 +01:00
5 changed files with 22 additions and 3 deletions

View file

@ -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
View file

@ -0,0 +1 @@
../../etc-git/files/gitignore

View file

@ -52,6 +52,19 @@
insertbefore: "^exit 0$"
when: release == 'jessie'
- 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 }}"

View file

@ -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
View file

@ -0,0 +1 @@
../../etc-git/tasks/repository.yml