From: nicoo Date: Sat, 24 Nov 2018 15:54:39 +0000 (+0100) Subject: ansible: Use clearer variable names in install-related roles X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=a7a05499442f361e03287f3a06e8c190c3ecaf4d;p=noc.git ansible: Use clearer variable names in install-related roles Rename `distro` to `install_distro` and `distcodename` to `install_codename`. --- diff --git a/ansible/roles/preseed/tasks/main.yml b/ansible/roles/preseed/tasks/main.yml index e8e62e7..54e348a 100644 --- a/ansible/roles/preseed/tasks/main.yml +++ b/ansible/roles/preseed/tasks/main.yml @@ -5,17 +5,17 @@ - set_fact: tmpdir: "{{ tmpdir.stdout }}" - initramfs: "{{ preseed_path | mandatory }}/{{ hostname }}-{{ distro }}-{{ distcodename }}.initrd.gz" + initramfs: "{{ preseed_path | mandatory }}/{{ hostname }}-{{ install_distro }}-{{ install_codename }}.initrd.gz" - name: Copy initramfs into position copy: remote_src: yes - src: "{{ debian_installer_path | mandatory }}/{{ distro }}-{{ distcodename }}/{{ hostvars[hostname].install_cooked.arch | default('amd64') }}/initrd.gz" + src: "{{ debian_installer_path | mandatory }}/{{ install_distro }}-{{ install_codename }}/{{ hostvars[hostname].install_cooked.arch | default('amd64') }}/initrd.gz" dest: "{{ initramfs }}" - name: Generate preseed file template: - src: "preseed_{{ distro }}-{{ distcodename }}.cfg.j2" + src: "preseed_{{ install_distro }}-{{ install_codename }}.cfg.j2" dest: "{{ tmpdir }}/preseed.cfg" - name: Generate authorized_keys file diff --git a/ansible/roles/usb-install/meta/main.yml b/ansible/roles/usb-install/meta/main.yml index 4fbb746..402b3d5 100644 --- a/ansible/roles/usb-install/meta/main.yml +++ b/ansible/roles/usb-install/meta/main.yml @@ -1,8 +1,8 @@ dependencies: - role: debian-installer distros: - - distro: "{{ distro }}" - codename: "{{ distcodename }}" + - distro: "{{ install_distro }}" + codename: "{{ install_codename }}" arch: [ "{{ install.arch }}" ] - role: preseed diff --git a/ansible/roles/vm/install/templates/libvirt-domain.xml.j2 b/ansible/roles/vm/install/templates/libvirt-domain.xml.j2 index 0f4858b..81c732a 100644 --- a/ansible/roles/vm/install/templates/libvirt-domain.xml.j2 +++ b/ansible/roles/vm/install/templates/libvirt-domain.xml.j2 @@ -6,8 +6,8 @@ hvm {% if run_installer %} - {{ debian_installer_path }}/{{ distro }}-{{ distcodename }}/{{ hostvars[hostname].install_cooked.arch | default('amd64') }}/linux - {{ preseed_path }}/{{ hostname }}-{{ distro }}-{{ distcodename }}.initrd.gz + {{ debian_installer_path }}/{{ install_distro }}-{{ install_codename }}/{{ hostvars[hostname].install_cooked.arch | default('amd64') }}/linux + {{ preseed_path }}/{{ hostname }}-{{ install_distro }}-{{ install_codename }}.initrd.gz console=ttyS0,115200n8 {% endif %} diff --git a/ansible/vm-install.sh b/ansible/vm-install.sh index 0846422..fcc8b5e 100755 --- a/ansible/vm-install.sh +++ b/ansible/vm-install.sh @@ -16,4 +16,4 @@ echo "installing $name with $distro/$codename" echo "" echo "######## running the install playbook ########" -exec ansible-playbook -e "hostname=$name" -e "distro=$distro" -e "distcodename=$codename" $@ $(basename "$0" .sh).yml +exec ansible-playbook -e "hostname=$name" -e "install_distro=$distro" -e "install_codename=$codename" $@ $(basename "$0" .sh).yml