This commit adds an *after* ordering dependency on the network device unit to the *wait-global-address@.service* template unit. Without this dependency, the service will wait forever for a global address if the device does not exist. With the dependency, though, if the device does not appear within the default timeout, the wait service will never start, causing all dependent services to fail, but allowing the boot process to continue.
31 lines
916 B
YAML
31 lines
916 B
YAML
- name: ensure wait-global-address script is installed
|
|
copy:
|
|
src=wait-global-address.sh
|
|
dest=/usr/local/libexec/wait-global-address.sh
|
|
mode=0755
|
|
- name: ensure wait-global-address unit is installed
|
|
copy:
|
|
src=wait-global-address.service
|
|
dest=/etc/systemd/system/wait-global-address@.service
|
|
mode=0644
|
|
notify: reload systemd
|
|
|
|
- meta: flush_handlers
|
|
- name: ensure wait-global-address service starts at boot
|
|
service:
|
|
name=wait-global-address@{{ storage_iface }}.service
|
|
enabled=yes
|
|
- name: ensure wait-global-address service is running
|
|
service:
|
|
name=wait-global-address@{{ storage_iface }}.service
|
|
state=started
|
|
|
|
- name: ensure storage volumes are mounted
|
|
mount:
|
|
path={{ item.mountpoint }}
|
|
src={{ item.host }}:{{ item.share }}
|
|
fstype={{ item.fstype|d('nfs') }}
|
|
opts={{ item.opts|d(omit) }}
|
|
state=mounted
|
|
with_items: '{{ mount_shared_volumes }}'
|