aboutsummaryrefslogtreecommitdiff
path: root/personal_infra
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2023-02-05 22:06:06 +0100
committeralex <alex@pdp7.net>2023-02-05 22:06:06 +0100
commit8558812069fefd7efdeeab2f10beb1662e7ed13f (patch)
treeb692bb4a2b3defa0260d9083d406ef74332d2b2b /personal_infra
parentf5f49d0894b4cb1a92672c04efc8943dbf07249f (diff)
Fix etc hosts
Diffstat (limited to 'personal_infra')
-rw-r--r--personal_infra/playbooks/roles/proxmox_create_lxc/tasks/main.yml19
1 files changed, 18 insertions, 1 deletions
diff --git a/personal_infra/playbooks/roles/proxmox_create_lxc/tasks/main.yml b/personal_infra/playbooks/roles/proxmox_create_lxc/tasks/main.yml
index f38ec1a0..cb46bd3e 100644
--- a/personal_infra/playbooks/roles/proxmox_create_lxc/tasks/main.yml
+++ b/personal_infra/playbooks/roles/proxmox_create_lxc/tasks/main.yml
@@ -1,4 +1,4 @@
----
+[I---
- name: download template
command: "pveam download local {{ flavors[proxmox.flavor].template }}_amd64.tar.xz"
args:
@@ -24,6 +24,23 @@
content: "{{ inventory_hostname }}"
dest: /rpool/data/subvol-{{ proxmox.id }}-disk-0/etc/hostname
delegate_to: "{{ proxmox.host }}"
+https://bugzilla.proxmox.com/show_bug.cgi?id=4515
+- name: set hosts
+ copy:
+ content: |
+ 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
+ ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
+
+ {% if network is defined and network.ip is defined %}
+ {{ network.ip }} {{ inventory_hostname }} {{ inventory_hostname|regex_search('^[^.]*') }}
+ {% endif %}
+ dest: /rpool/data/subvol-{{ proxmox.id }}-disk-0/etc/hosts
+ delegate_to: "{{ proxmox.host }}"
+- name: set hosts
+ file:
+ path: /etc/.pve-ignore.hosts
+ state: touch
+ delegate_to: "{{ proxmox.host }}"
- name: start host
shell: "{ pct status {{ proxmox.id }} | grep running ; } || pct start {{ proxmox.id }}"
delegate_to: "{{ proxmox.host }}"