more adjusting to ansible not wanting | in when
This commit is contained in:
parent
ca009a7d62
commit
d8d79f7933
5 changed files with 10 additions and 10 deletions
|
@ -18,7 +18,7 @@
|
|||
register: facts
|
||||
- name: install python2 and dnf stuff
|
||||
raw: dnf -y install python-dnf libselinux-python yum
|
||||
when: facts|failed
|
||||
when: facts is failed
|
||||
|
||||
- name: cloud basic setup
|
||||
hosts: copr-keygen-stg:copr-keygen
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
- name: install python2 and dnf stuff
|
||||
raw: dnf -y install python-dnf libselinux-python
|
||||
when: facts|failed
|
||||
when: facts is failed
|
||||
|
||||
- name: provision instance
|
||||
hosts: tmp_just_created
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
- name: start dnf-automatic.timer if it is not active
|
||||
command: systemctl start dnf-automatic.timer
|
||||
when: automaticative|failed and ansible_distribution_major_version|int < 26
|
||||
when: automaticative is failed and ansible_distribution_major_version|int < 26
|
||||
|
||||
- name: enable and start dnf-automatic f26+
|
||||
command: systemctl enable dnf-automatic-install.timer
|
||||
|
@ -59,7 +59,7 @@
|
|||
|
||||
- name: start dnf-automatic-install.timer if it is not active
|
||||
command: systemctl start dnf-automatic-install.timer
|
||||
when: automaticative|failed and ansible_distribution_major_version|int >= 26
|
||||
when: automaticative is failed and ansible_distribution_major_version|int >= 26
|
||||
|
||||
- name: disable silly makecache timer
|
||||
systemd: name=dnf-makecache masked=yes
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
command: openssl req -new -nodes -x509 -subj "{{ ssl_self_signed_string }}" -days 3650 -keyout /etc/nginx/conf.d/ssl.key -out /etc/nginx/conf.d/ssl.pem -extensions v3_ca
|
||||
args:
|
||||
creates: /etc/nginx/conf.d/ssl.pem
|
||||
when: setup_ssl_key|failed or setup_ssl_pem|failed
|
||||
when: setup_ssl_key is failed or setup_ssl_pem is failed
|
||||
|
||||
- name: warn that the next step takes a while
|
||||
debug:
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
floating_ips:
|
||||
- "{{public_ip}}"
|
||||
register: nova_result
|
||||
when: host_is_up|failed
|
||||
when: host_is_up is failed
|
||||
|
||||
# instance can be both id and name, volume must be id
|
||||
# volume must be id
|
||||
|
@ -53,27 +53,27 @@
|
|||
|
||||
- name: wait for he host to be hot
|
||||
local_action: wait_for host={{ public_ip }} port=22 delay=1 timeout=600
|
||||
when: host_is_up|failed
|
||||
when: host_is_up is failed
|
||||
|
||||
# SSH is up and running, however cloud-init still did not deployed ssh keypair
|
||||
# we have to wait some time. 10 sec is usually enough, but not always.
|
||||
|
||||
- name: waiting for cloud-init
|
||||
pause: seconds=30
|
||||
when: host_is_up|failed
|
||||
when: host_is_up is failed
|
||||
|
||||
- name: gather ssh host key from new instance
|
||||
local_action: command ssh-keyscan -t rsa {{ inventory_hostname }}
|
||||
ignore_errors: True
|
||||
register: hostkey
|
||||
when: host_is_up|failed
|
||||
when: host_is_up is failed
|
||||
|
||||
- name: add new ssh host key (until we can sign it)
|
||||
local_action: known_hosts path={{item}} key="{{ hostkey.stdout }}" host={{ inventory_hostname }} state=present
|
||||
ignore_errors: True
|
||||
with_items:
|
||||
- /root/.ssh/known_hosts
|
||||
when: host_is_up|failed
|
||||
when: host_is_up is failed
|
||||
|
||||
#
|
||||
# Next we try and gather facts. If the host doesn't have python2 this will fail.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue