Problema en /etc/hosts
Si existe la entrada del contenido de la variable nextcloud_fqdn
en el archivo /etc/hosts
en la máquina objetivo del rol nextcloud
. El playbook agrega agrega una línea extra con el valor de la variable nextcloud_fqdn
y el valor de la variable nextcloud_hostname
, esto ocasiona que el rol se detenga en la etapa de actualización de repositorios de remi.
eg.
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.172 localtest.sotolitolabs.com
192.168.1.172 localtest.sotolitolabs.com nextcloud
Causará el error.
Se debe:
- Modificar la entrada de el task: roles/pre/tasks/main.yml
- name: Update the /etc/hosts file with node host name
tags: etchostsupdate
become: yes
become_user: root
lineinfile:
path: "/etc/hosts"
regexp: ".*\t{{ ansible_hostname }}"
#TODO: crear una variable que tenga la IP del balanceador
line: "{{ nextcloud_host_ip }}\t{{ nextcloud_fqdn }} {{ nextcloud_hostname }}"
state: present
backup: yes
register: etchostsupdate
por:
- name: Update the /etc/hosts file with node host name
tags: etchostsupdate
become: yes
become_user: root
lineinfile:
path: "/etc/hosts"
regexp: ".*\t{{ nextcloud_fqdn }}" <<<-----
#TODO: crear una variable que tenga la IP del balanceador
line: "{{ nextcloud_host_ip }}\t{{ nextcloud_fqdn }} {{ nextcloud_hostname }}"
state: present
backup: yes
register: etchostsupdate
- Revisar porqué es necesario tener el contenido de la variable
nextcloud_hostname
en/etc/hosts