Merge "Verify if hosts file already managed with OSA"

This commit is contained in:
Zuul
2022年03月23日 12:14:34 +00:00
committed by Gerrit Code Review

View File

@@ -30,21 +30,27 @@
- rabbitmq-package-rpm
- rabbitmq-package-rpm-get
- name:Fix /etc/hosts
lineinfile:
dest:/etc/hosts
state:present
line:"{{ item.address }} {{ item.hostnames | join(' ') }}"
with_items:"{{ rabbitmq_hosts_entries }}"
tags:
- rabbitmq-config
- name:Ensure localhost /etc/hosts entry is correct
lineinfile:
dest:/etc/hosts
state:present
line:'127.0.0.1 localhost'
regexp:'^127.0.0.1'
- name:Manage /etc/hosts files
block:
- name:Fail if hosts file is not managed yet
command:grep "OPENSTACK-ANSIBLE MANAGED BLOCK" /etc/hosts
changed_when:false
rescue:
- name:Rescue failure and add required records
lineinfile:
dest:/etc/hosts
state:present
line:"{{ item.address }} {{ item.hostnames | join(' ') }}"
with_items:"{{ rabbitmq_hosts_entries }}"
always:
- name:Ensure localhost /etc/hosts entry is correct
lineinfile:
dest:/etc/hosts
state:present
line:'127.0.0.1 localhost'
regexp:'^127\.0\.0\.1'
when:
- rabbitmq_manage_hosts_entries | bool
tags:
- rabbitmq-config
Reference in New Issue
openstack/openstack-ansible-rabbitmq_server
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.