change the condition so it works even when the variable is not defined

This commit is contained in:
Miroslav Suchý 2015-05-14 16:08:56 +02:00
parent f303f64dfe
commit b78d1f277e

View file

@ -23,7 +23,7 @@
- name: enable the service - name: enable the service
action: service name=ntpd state=running enabled=true action: service name=ntpd state=running enabled=true
when: not ansible_cmdline.ostree when: ansible_cmdline.ostree is not defined
#- name: edit hostname to be instance name - prefix hostbase var if it exists #- name: edit hostname to be instance name - prefix hostbase var if it exists
# action: shell hostname {{ hostbase }}`curl -s http://169.254.169.254/latest/meta-data/instance-id` # action: shell hostname {{ hostbase }}`curl -s http://169.254.169.254/latest/meta-data/instance-id`
@ -63,7 +63,7 @@
- name: update all - name: update all
command: dnf -y update creates=/etc/sysconfig/global-update-applied command: dnf -y update creates=/etc/sysconfig/global-update-applied
register: updated register: updated
when: ansible_distribution_major_version > '21' and not ansible_cmdline.ostree when: ansible_distribution_major_version > '21' and ansible_cmdline.ostree is not defined
tags: tags:
- packages - packages