aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/lxc-host/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/lxc-host/tasks/main.yml')
-rw-r--r--ansible/roles/lxc-host/tasks/main.yml32
1 files changed, 10 insertions, 22 deletions
diff --git a/ansible/roles/lxc-host/tasks/main.yml b/ansible/roles/lxc-host/tasks/main.yml
index 676e27e..ba511c9 100644
--- a/ansible/roles/lxc-host/tasks/main.yml
+++ b/ansible/roles/lxc-host/tasks/main.yml
@@ -1,23 +1,11 @@
----
-#- debug:
-# msg: key="{{ item.key }}", ipv4="{{ item.value.ipv4 }}"
-# with_dict: "{{ lxc_containers }}"
-- name: Set IPv4 address
- lineinfile:
- path: "/var/lib/lxc/{{ item.key }}/config"
- regexp: "lxc.network.ipv4 *="
- line: "lxc.network.ipv4 = {{ item.value.ipv4.address }}/{{ item.value.ipv4.netmask }}"
- with_dict: "{{ lxc_containers }}"
-- name: Set IPv4 gateway
- lineinfile:
- path: "/var/lib/lxc/{{ item.key }}/config"
- regexp: "lxc.network.ipv4.gateway *="
- line: "lxc.network.ipv4.gateway = {{ item.value.ipv4.gateway }}"
- insertafter: "lxc.network.ipv4 *="
- with_dict: "{{ lxc_containers }}"
-- name: Set logfile
- lineinfile:
- path: "/var/lib/lxc/{{ item.key }}/config"
- regexp: "lxc.logfile *="
- line: "lxc.logfile = /var/lib/lxc/{{ item.key }}/{{ item.key }}.log"
+- name: Remove default network setup packages
+ apt:
+ name: "{{ item }}"
+ install_recommends: no
+ with_items:
+ - python-lxc
+
+- include_tasks: per-host.yml
+ vars:
+ i: "{{ item }}"
with_dict: "{{ lxc_containers }}"