make role conditional on variable

master
Michael Wilson 3 years ago
parent 371aa306d9
commit f8836c4c1e
  1. 38
      hetzner/autoinstall/tasks/main.yml

@ -1,18 +1,20 @@
- name: copy setup.conf template - block:
template: when: hetzner_autoinstall
src: setup.conf - name: copy setup.conf template
dest: "{{ autoinstall_setup_conf_dest }}" template:
src: setup.conf
- name: copy post install script dest: "{{ autoinstall_setup_conf_dest }}"
copy:
src: post-install.sh - name: copy post install script
dest: "{{ post_install_dest }}" copy:
owner: root src: post-install.sh
mode: "0755" dest: "{{ post_install_dest }}"
owner: root
- name: copy authorized_keys mode: "0755"
src: "{{ autoinstall_authorized_keys_src }}"
dest: "{{ autoinstall_authorized_keys_dest }}" - name: copy authorized_keys
src: "{{ autoinstall_authorized_keys_src }}"
- name: run autoinstall dest: "{{ autoinstall_authorized_keys_dest }}"
command: "installimage -a -c {{ setup_conf_dest }} -x {{ post_install_dest }}"
- name: run autoinstall
command: "installimage -a -c {{ setup_conf_dest }} -x {{ post_install_dest }}"

Loading…
Cancel
Save