Change ansible_fqdn to inventory_hostname. This fixes some few hosts that have incorrect reverse dns
and shouldn't break any others since we always use fully qualified in our inventory.
This commit is contained in:
parent
bc159045c8
commit
a32f8b9e4a
19 changed files with 31 additions and 33 deletions
|
@ -86,8 +86,8 @@
|
||||||
- services
|
- services
|
||||||
|
|
||||||
- name: Check for pending updates
|
- name: Check for pending updates
|
||||||
# script: {{ scripts }}/needs-updates --host {{ ansible_fqdn }}
|
# script: {{ scripts }}/needs-updates --host {{ inventory_hostname }}
|
||||||
script: needs-updates --host {{ ansible_fqdn }}
|
script: needs-updates --host {{ inventory_hostname }}
|
||||||
register: list_update
|
register: list_update
|
||||||
delegate_to: 127.0.0.1
|
delegate_to: 127.0.0.1
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
@ -215,7 +215,7 @@
|
||||||
- selinux
|
- selinux
|
||||||
|
|
||||||
- name: resolve last persisted dir - if one is present
|
- name: resolve last persisted dir - if one is present
|
||||||
local_action: shell ls -d -1 {{datadir_prfx_path}}/{{ansible_fqdn}}-* 2>/dev/null | sort -r | head -1
|
local_action: shell ls -d -1 {{datadir_prfx_path}}/{{inventory_hostname}}-* 2>/dev/null | sort -r | head -1
|
||||||
register: last_dir
|
register: last_dir
|
||||||
changed_when: False
|
changed_when: False
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
|
@ -231,17 +231,17 @@
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
||||||
- name: create persisting-state directory
|
- name: create persisting-state directory
|
||||||
local_action: file path=/{{datadir_prfx_path}}/{{ansible_fqdn}}-{{timestamp.stdout}} state=directory
|
local_action: file path=/{{datadir_prfx_path}}/{{inventory_hostname}}-{{timestamp.stdout}} state=directory
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
||||||
- name: fetch file list
|
- name: fetch file list
|
||||||
fetch: src={{item}} dest=/{{datadir_prfx_path}}/{{ansible_fqdn}}-{{timestamp.stdout}}/ flat=true
|
fetch: src={{item}} dest=/{{datadir_prfx_path}}/{{inventory_hostname}}-{{timestamp.stdout}}/ flat=true
|
||||||
with_items: file_list.stdout_lines
|
with_items: file_list.stdout_lines
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
||||||
|
|
||||||
- name: diff the new files with last ones presisted
|
- name: diff the new files with last ones presisted
|
||||||
local_action: shell for file in {{datadir_prfx_path}}/{{ansible_fqdn}}-{{timestamp.stdout}}/*; do filename=$(basename $file); diff {{datadir_prfx_path}}/{{ansible_fqdn}}-{{timestamp.stdout}}/$filename {{last_dir.stdout.strip(':')}}/$filename; done
|
local_action: shell for file in {{datadir_prfx_path}}/{{inventory_hostname}}-{{timestamp.stdout}}/*; do filename=$(basename $file); diff {{datadir_prfx_path}}/{{inventory_hostname}}-{{timestamp.stdout}}/$filename {{last_dir.stdout.strip(':')}}/$filename; done
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
changed_when: False
|
changed_when: False
|
||||||
register: file_diff
|
register: file_diff
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
|
|
||||||
- name: fedmsg certs
|
- name: fedmsg certs
|
||||||
copy: >
|
copy: >
|
||||||
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(ansible_fqdn)}}.crt"
|
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(inventory_hostname)}}.crt"
|
||||||
dest=/etc/pki/fedmsg/
|
dest=/etc/pki/fedmsg/
|
||||||
mode=644
|
mode=644
|
||||||
owner={{item['owner']}}
|
owner={{item['owner']}}
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
|
|
||||||
- name: fedmsg keys
|
- name: fedmsg keys
|
||||||
copy: >
|
copy: >
|
||||||
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(ansible_fqdn)}}.key"
|
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(inventory_hostname)}}.key"
|
||||||
dest=/etc/pki/fedmsg/
|
dest=/etc/pki/fedmsg/
|
||||||
mode=0640
|
mode=0640
|
||||||
owner={{item['owner']}}
|
owner={{item['owner']}}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
copy: src={{ item }} dest=/etc/resolv.conf
|
copy: src={{ item }} dest=/etc/resolv.conf
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ resolvconf }}"
|
- "{{ resolvconf }}"
|
||||||
- resolv.conf/{{ ansible_fqdn }}
|
- resolv.conf/{{ inventory_hostname }}
|
||||||
- resolv.conf/{{ host_group }}
|
- resolv.conf/{{ host_group }}
|
||||||
- resolv.conf/{{ datacenter }}
|
- resolv.conf/{{ datacenter }}
|
||||||
- resolv.conf/resolv.conf
|
- resolv.conf/resolv.conf
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
copy: src={{ item }} dest=/etc/ssh/sshd_config mode=600
|
copy: src={{ item }} dest=/etc/ssh/sshd_config mode=600
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ sshd_config }}"
|
- "{{ sshd_config }}"
|
||||||
- ssh/sshd_config.{{ ansible_fqdn }}
|
- ssh/sshd_config.{{ inventory_hostname }}
|
||||||
- ssh/sshd_config.{{ host_group }}
|
- ssh/sshd_config.{{ host_group }}
|
||||||
- ssh/sshd_config.{{ dist_tag }}
|
- ssh/sshd_config.{{ dist_tag }}
|
||||||
- ssh/sshd_config.{{ ansible_distribution }}
|
- ssh/sshd_config.{{ ansible_distribution }}
|
||||||
|
@ -191,7 +191,7 @@
|
||||||
template: src={{ item }} dest=/etc/sysconfig/iptables mode=600 validate="/sbin/iptables-restore --text %s"
|
template: src={{ item }} dest=/etc/sysconfig/iptables mode=600 validate="/sbin/iptables-restore --text %s"
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- iptables/iptables.{{ datacenter }}
|
- iptables/iptables.{{ datacenter }}
|
||||||
- iptables/iptables.{{ ansible_fqdn }}
|
- iptables/iptables.{{ inventory_hostname }}
|
||||||
- iptables/iptables.{{ host_group }}
|
- iptables/iptables.{{ host_group }}
|
||||||
- iptables/iptables.{{ env }}
|
- iptables/iptables.{{ env }}
|
||||||
- iptables/iptables
|
- iptables/iptables
|
||||||
|
@ -215,7 +215,7 @@
|
||||||
template: src={{ item }} dest=/etc/sysconfig/ip6tables mode=600 backup=yes
|
template: src={{ item }} dest=/etc/sysconfig/ip6tables mode=600 backup=yes
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- iptables/ip6tables.{{ datacenter }}
|
- iptables/ip6tables.{{ datacenter }}
|
||||||
- iptables/ip6tables.{{ ansible_fqdn }}
|
- iptables/ip6tables.{{ inventory_hostname }}
|
||||||
- iptables/ip6tables.{{ host_group }}
|
- iptables/ip6tables.{{ host_group }}
|
||||||
- iptables/ip6tables.{{ env }}
|
- iptables/ip6tables.{{ env }}
|
||||||
- iptables/ip6tables
|
- iptables/ip6tables
|
||||||
|
@ -249,7 +249,7 @@
|
||||||
- name: rsyslog.conf
|
- name: rsyslog.conf
|
||||||
copy: src={{ item }} dest=/etc/rsyslog.conf mode=644
|
copy: src={{ item }} dest=/etc/rsyslog.conf mode=644
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- rsyslog/rsyslog.conf.{{ ansible_fqdn }}
|
- rsyslog/rsyslog.conf.{{ inventory_hostname }}
|
||||||
- rsyslog/rsyslog.conf.{{ dist_tag }}
|
- rsyslog/rsyslog.conf.{{ dist_tag }}
|
||||||
- rsyslog/rsyslog.conf.default
|
- rsyslog/rsyslog.conf.default
|
||||||
notify:
|
notify:
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
copy: src={{ item }} dest=/etc/postfix/main.cf
|
copy: src={{ item }} dest=/etc/postfix/main.cf
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ postfix_maincf }}"
|
- "{{ postfix_maincf }}"
|
||||||
- "postfix/main.cf/main.cf.{{ ansible_fqdn }}"
|
- "postfix/main.cf/main.cf.{{ inventory_hostname }}"
|
||||||
- "postfix/main.cf/main.cf.{{ host_group }}"
|
- "postfix/main.cf/main.cf.{{ host_group }}"
|
||||||
- "postfix/main.cf/main.cf.{{ postfix_group }}"
|
- "postfix/main.cf/main.cf.{{ postfix_group }}"
|
||||||
- "postfix/main.cf/main.cf.{{ datacenter }}"
|
- "postfix/main.cf/main.cf.{{ datacenter }}"
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
copy: src={{ item }} dest=/etc/postfix/master.cf mode=0644
|
copy: src={{ item }} dest=/etc/postfix/master.cf mode=0644
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ postfix_mastercf }}"
|
- "{{ postfix_mastercf }}"
|
||||||
- "postfix/master.cf/master.cf.{{ ansible_fqdn }}"
|
|
||||||
- "postfix/master.cf/master.cf.{{ inventory_hostname }}"
|
- "postfix/master.cf/master.cf.{{ inventory_hostname }}"
|
||||||
- "postfix/master.cf/master.cf.{{ host_group }}"
|
- "postfix/master.cf/master.cf.{{ host_group }}"
|
||||||
- "postfix/master.cf/master.cf.{{ postfix_group }}"
|
- "postfix/master.cf/master.cf.{{ postfix_group }}"
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<Plugin exec>
|
<Plugin exec>
|
||||||
Exec "nobody" "/usr/local/bin/collectd-postgres.sh" "-h" "{{ ansible_fqdn }}" "-p" "10"
|
Exec "nobody" "/usr/local/bin/collectd-postgres.sh" "-h" "{{ inventory_hostname }}" "-p" "10"
|
||||||
</Plugin>
|
</Plugin>
|
||||||
|
|
|
@ -23,7 +23,7 @@ http:
|
||||||
|
|
||||||
# Cert information to place certificate files on system
|
# Cert information to place certificate files on system
|
||||||
cert:
|
cert:
|
||||||
dest_dir: "/etc/pki/docker/{{ ansible_fqdn }}{{ http.addr }}"
|
dest_dir: "/etc/pki/docker/{{ inventory_hostname }}{{ http.addr }}"
|
||||||
cert_src: "ca.crt"
|
cert_src: "ca.crt"
|
||||||
cert_dest: "ca.crt"
|
cert_dest: "ca.crt"
|
||||||
key_src: "ca.key"
|
key_src: "ca.key"
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
- name: setup /etc/fas.conf for client use
|
- name: setup /etc/fas.conf for client use
|
||||||
template: src={{ item }} dest=/etc/fas.conf owner=root mode=600
|
template: src={{ item }} dest=/etc/fas.conf owner=root mode=600
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- ../templates/{{ ansible_fqdn }}.fas.conf.j2
|
- ../templates/{{ inventory_hostname }}.fas.conf.j2
|
||||||
- ../templates/{{ ansible_hostname }}.fas.conf.j2
|
- ../templates/{{ ansible_hostname }}.fas.conf.j2
|
||||||
- ../templates/{{ ansible_hostname }}.fas.conf.j2
|
- ../templates/{{ ansible_hostname }}.fas.conf.j2
|
||||||
- ../templates/fas.conf.j2
|
- ../templates/fas.conf.j2
|
||||||
|
|
|
@ -258,7 +258,7 @@
|
||||||
|
|
||||||
- name: fedmsg certs
|
- name: fedmsg certs
|
||||||
copy: >
|
copy: >
|
||||||
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(ansible_fqdn)}}.crt"
|
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(inventory_hostname)}}.crt"
|
||||||
dest=/etc/pki/fedmsg/
|
dest=/etc/pki/fedmsg/
|
||||||
mode=644
|
mode=644
|
||||||
owner={{item['owner']}}
|
owner={{item['owner']}}
|
||||||
|
@ -272,7 +272,7 @@
|
||||||
|
|
||||||
- name: fedmsg keys
|
- name: fedmsg keys
|
||||||
copy: >
|
copy: >
|
||||||
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(ansible_fqdn)}}.key"
|
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(inventory_hostname)}}.key"
|
||||||
dest=/etc/pki/fedmsg/
|
dest=/etc/pki/fedmsg/
|
||||||
mode=0640
|
mode=0640
|
||||||
owner={{item['owner']}}
|
owner={{item['owner']}}
|
||||||
|
|
|
@ -15,7 +15,7 @@ config = dict(
|
||||||
# This is the set of certs for this host, dynamically generated from the
|
# This is the set of certs for this host, dynamically generated from the
|
||||||
# ``fedmsg_certs`` host vars
|
# ``fedmsg_certs`` host vars
|
||||||
{% for cert in fedmsg_certs %}
|
{% for cert in fedmsg_certs %}
|
||||||
("{{cert.get('alias', cert['service'])}}.{{inventory_hostname_short}}", "{{cert['service']}}-{{fedmsg_fqdn | default(ansible_fqdn)}}"),
|
("{{cert.get('alias', cert['service'])}}.{{inventory_hostname_short}}", "{{cert['service']}}-{{fedmsg_fqdn | default(inventory_hostname)}}"),
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
] + [
|
] + [
|
||||||
# This is the beginning of the static list. We should eventually remove
|
# This is the beginning of the static list. We should eventually remove
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- files:
|
- files:
|
||||||
- "{{ inventory_hostname }}-hosts"
|
- "{{ inventory_hostname }}-hosts"
|
||||||
- "{{ ansible_fqdn }}-hosts"
|
|
||||||
- "{{ ansible_hostname }}-hosts"
|
- "{{ ansible_hostname }}-hosts"
|
||||||
- "{{ host_group }}-hosts"
|
- "{{ host_group }}-hosts"
|
||||||
- "{{ ansible_domain }}-hosts"
|
- "{{ ansible_domain }}-hosts"
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
- name: Install keepalived failover script for host (or default)
|
- name: Install keepalived failover script for host (or default)
|
||||||
copy: src={{ item }} dest=/usr/local/bin/keepalived-notify.sh mode=755
|
copy: src={{ item }} dest=/usr/local/bin/keepalived-notify.sh mode=755
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- keepalived-notify.sh.{{ ansible_fqdn }}
|
- keepalived-notify.sh.{{ inventory_hostname }}
|
||||||
- keepalived-notify.sh
|
- keepalived-notify.sh
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<VirtualHost *>
|
<VirtualHost *>
|
||||||
ServerName {{ ansible_fqdn }}
|
ServerName {{ inventory_hostname }}
|
||||||
|
|
||||||
WSGIDaemonProcess koschei user=koschei group=koschei threads=5 home=/usr/share/koschei
|
WSGIDaemonProcess koschei user=koschei group=koschei threads=5 home=/usr/share/koschei
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
copy: src={{ item }} dest=/etc/my.cnf owner=root group=root mode=0644
|
copy: src={{ item }} dest=/etc/my.cnf owner=root group=root mode=0644
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ mariadb_config }}"
|
- "{{ mariadb_config }}"
|
||||||
- my.cnf.{{ ansible_fqdn }}
|
- my.cnf.{{ inventory_hostname }}
|
||||||
- my.cnf.{{ host_group }}
|
- my.cnf.{{ host_group }}
|
||||||
- my.cnf.{{ dist_tag }}
|
- my.cnf.{{ dist_tag }}
|
||||||
- my.cnf.{{ ansible_distribution }}
|
- my.cnf.{{ ansible_distribution }}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
- nfs/server
|
- nfs/server
|
||||||
|
|
||||||
- name: setup /etc/exports
|
- name: setup /etc/exports
|
||||||
copy: src={{ ansible_fqdn }}-exports dest=/etc/exports
|
copy: src={{ inventory_hostname }}-exports dest=/etc/exports
|
||||||
register: exports
|
register: exports
|
||||||
tags:
|
tags:
|
||||||
- nfs/server
|
- nfs/server
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
- name: generate cert for authenticating proxy - self-signed certificate
|
- name: generate cert for authenticating proxy - self-signed certificate
|
||||||
command: >
|
command: >
|
||||||
openssl req -new -nodes -x509
|
openssl req -new -nodes -x509
|
||||||
-subj "/C=CZ/ST=SelfSigned/L=SelfSigned/O=IT/CN={{ ansible_fqdn }}"
|
-subj "/C=CZ/ST=SelfSigned/L=SelfSigned/O=IT/CN={{ inventory_hostname }}"
|
||||||
-days 3650
|
-days 3650
|
||||||
-keyout {{ osbs_proxy_key_file }}
|
-keyout {{ osbs_proxy_key_file }}
|
||||||
-out {{ osbs_proxy_cert_file }}
|
-out {{ osbs_proxy_cert_file }}
|
||||||
|
|
|
@ -96,7 +96,7 @@ kubernetesMasterConfig:
|
||||||
servicesNodePortRange: 30000-32767
|
servicesNodePortRange: 30000-32767
|
||||||
servicesSubnet: 172.30.0.0/16
|
servicesSubnet: 172.30.0.0/16
|
||||||
staticNodeNames:
|
staticNodeNames:
|
||||||
- {{ ansible_fqdn }}
|
- {{ inventory_hostname }}
|
||||||
masterClients:
|
masterClients:
|
||||||
externalKubernetesKubeConfig: ""
|
externalKubernetesKubeConfig: ""
|
||||||
openshiftLoopbackKubeConfig: openshift-master.kubeconfig
|
openshiftLoopbackKubeConfig: openshift-master.kubeconfig
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
|
|
||||||
- name: fedmsg certs
|
- name: fedmsg certs
|
||||||
copy: >
|
copy: >
|
||||||
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(ansible_fqdn)}}.crt"
|
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(inventory_hostname)}}.crt"
|
||||||
dest=/etc/pki/fedmsg/
|
dest=/etc/pki/fedmsg/
|
||||||
mode=644
|
mode=644
|
||||||
owner={{item['owner']}}
|
owner={{item['owner']}}
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
|
|
||||||
- name: fedmsg keys
|
- name: fedmsg keys
|
||||||
copy: >
|
copy: >
|
||||||
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(ansible_fqdn)}}.key"
|
src="{{ private }}/files/fedmsg-certs/keys/{{item['service']}}-{{fedmsg_fqdn | default(inventory_hostname)}}.key"
|
||||||
dest=/etc/pki/fedmsg/
|
dest=/etc/pki/fedmsg/
|
||||||
mode=0640
|
mode=0640
|
||||||
owner={{item['owner']}}
|
owner={{item['owner']}}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
copy: src={{ item }} dest=/etc/rsyncd.conf mode=644
|
copy: src={{ item }} dest=/etc/rsyncd.conf mode=644
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ rsyncd_conf }}"
|
- "{{ rsyncd_conf }}"
|
||||||
- rsyncd.conf.{{ ansible_fqdn }}
|
- rsyncd.conf.{{ inventory_hostname }}
|
||||||
- rsyncd.conf.{{ host_group }}
|
- rsyncd.conf.{{ host_group }}
|
||||||
- rsyncd.conf.{{ rsync_group }}
|
- rsyncd.conf.{{ rsync_group }}
|
||||||
- rsyncd.conf.default
|
- rsyncd.conf.default
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
copy: src={{ item }} dest=/etc/xinetd.d/rsync mode=644
|
copy: src={{ item }} dest=/etc/xinetd.d/rsync mode=644
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ rsync }}"
|
- "{{ rsync }}"
|
||||||
- rsync.{{ ansible_fqdn }}
|
- rsync.{{ inventory_hostname }}
|
||||||
- rsync.{{ host_group }}
|
- rsync.{{ host_group }}
|
||||||
- rsync.{{ rsync_group }}
|
- rsync.{{ rsync_group }}
|
||||||
- rsync.default
|
- rsync.default
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- files:
|
- files:
|
||||||
- "{{ sudoers }}"
|
- "{{ sudoers }}"
|
||||||
- "{{ private }}/files/sudo/{{ ansible_fqdn }}-sudoers"
|
- "{{ private }}/files/sudo/{{ inventory_hostname }}-sudoers"
|
||||||
- "{{ private }}/files/sudo/{{ ansible_hostname }}-sudoers"
|
- "{{ private }}/files/sudo/{{ ansible_hostname }}-sudoers"
|
||||||
- "{{ private }}/files/sudo/{{ ansible_domain }}-sudoers"
|
- "{{ private }}/files/sudo/{{ ansible_domain }}-sudoers"
|
||||||
skip: true
|
skip: true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue