Commit cb27e97f authored by Oyvind.Gjesdal's avatar Oyvind.Gjesdal
Browse files

add default nrec behaviour on volumes, needs-restarting, authorized_keys and...

add default nrec behaviour on volumes, needs-restarting, authorized_keys and hostname (to turn off for vmware)
parent 409eaab3
......@@ -11,7 +11,7 @@ cron_email: false
cron_users:
- root
- "{{ worker_name }}"
cron_yum_update_needs_restarting: true
nrec_instance: true
cron_mailto:
- "oyvind.gjesdal@uib.no"
ssh_public_keys: []
......
......@@ -6,7 +6,7 @@
- name: "import volume.yml"
import_tasks: volume.yml
when: "volumes | length > 0"
when: "volumes | length > 0 and nrec_instance | bool"
become: true
- name: "cron job for yum update and rebooting on kernel changes"
......@@ -17,7 +17,7 @@
user: "root"
job: '/usr/bin/sh -c "yum update -y && /usr/bin/needs-restarting -r now || /usr/sbin/shutdown -r" > /dev/null'
become: true
when: "cron_yum_update_needs_restarting | default(true) | bool"
when: "nrec_instance | bool"
- name: Set authorized key from url
authorized_key:
......@@ -25,6 +25,7 @@
state: present
key: "{{ item }}"
with_items: "{{ ssh_public_keys }}"
when: "nrec_instance | bool"
- name: "Configure environment ($PATH)."
template:
......@@ -76,7 +77,7 @@
line: '{{ ansible_default_ipv4.address }} {{ hostname }} {{ hostname_short | default(hostname | regex_replace("\..+")) }}'
path: "/etc/hosts"
become: true
when: "hostname is defined"
when: "hostname is defined and nrec_instance | bool"
- name: "install extra packages if defined"
yum:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment