From 8aa59da32581dfc2dd924c1e036fd7c3e8408705 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 24 Oct 2022 17:32:38 +1300 Subject: [PATCH] arranging vars --- ansible/inventory/group_vars/all.yaml | 4 +++- ansible/inventory/host_vars/hv00/hv00.yaml | 2 ++ ansible/roles/msmtp/templates/aliases.j2 | 2 +- ansible/roles/vm_template/tasks/main.yml | 6 +++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ansible/inventory/group_vars/all.yaml b/ansible/inventory/group_vars/all.yaml index 71a35d3..0d88357 100644 --- a/ansible/inventory/group_vars/all.yaml +++ b/ansible/inventory/group_vars/all.yaml @@ -3,4 +3,6 @@ # connection ansible_connection: ssh -ansible_become_method: sudo \ No newline at end of file +ansible_become_method: sudo +ansible_become_user: root +ansible_port: 22 \ No newline at end of file diff --git a/ansible/inventory/host_vars/hv00/hv00.yaml b/ansible/inventory/host_vars/hv00/hv00.yaml index e736e95..8ff7877 100644 --- a/ansible/inventory/host_vars/hv00/hv00.yaml +++ b/ansible/inventory/host_vars/hv00/hv00.yaml @@ -1,3 +1,5 @@ --- +ansible_host: hv00.balsillie.net + vhd_template: "kube_template_vda.qcow2" root_vhd_pool_dir: "/vhds" # No trailing / \ No newline at end of file diff --git a/ansible/roles/msmtp/templates/aliases.j2 b/ansible/roles/msmtp/templates/aliases.j2 index 0e6721c..ead5931 100644 --- a/ansible/roles/msmtp/templates/aliases.j2 +++ b/ansible/roles/msmtp/templates/aliases.j2 @@ -1 +1 @@ -root: {{ smtp_admin }} +root: {{ smtp_admin }} diff --git a/ansible/roles/vm_template/tasks/main.yml b/ansible/roles/vm_template/tasks/main.yml index 2b57f62..27a6f4c 100644 --- a/ansible/roles/vm_template/tasks/main.yml +++ b/ansible/roles/vm_template/tasks/main.yml @@ -4,4 +4,8 @@ when: template_created is changed ansible.builtin.shell: cmd: | - virt-sysprep -a {{ root_vhd_pool_dir }}/{{ vhd_template }} \ No newline at end of file + virt-sysprep -a {{ root_vhd_pool_dir }}/{{ vhd_template }} \ + --format qcow2 \ + --delete /etc/systemd/network/* \ + --keep-user-accounts ladmin \ + --enable user-account,firewall-rules \