Changed "ansible_fqdn" to "inventory_hostname"

Due to some hosts misconfigure fqdn themselves
dehydrated
Felix Stupp 5 years ago
parent 574b07f2f4
commit fb0c1f0901
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -27,7 +27,7 @@
ssh_key_type: ed25519
ssh_key_file: .ssh/id_ed25519
ssh_key_passphrase: "{{ password }}"
ssh_key_comment: "{{ username }}@{{ ansible_fqdn }} {{ ansible_date_time.date }}"
ssh_key_comment: "{{ username }}@{{ inventory_hostname }} {{ ansible_date_time.date }}"
- name: Configure home directory
file:

@ -24,13 +24,13 @@
state: present
generate_ssh_key: yes
ssh_key_type: ed25519
ssh_key_comment: "root@{{ ansible_fqdn }}"
ssh_key_comment: "root@{{ inventory_hostname }}"
register: root_user
- name: Store ssh public key local
copy:
content: "{{ root_user.ssh_public_key }}\n"
dest: "public_keys/ssh/root@{{ ansible_fqdn }}"
dest: "public_keys/ssh/root@{{ inventory_hostname }}"
delegate_to: localhost
vars:
ansible_become: no

@ -46,7 +46,7 @@
- name: Create directory for host keys locally
file:
path: "{{ global_ssh_host_key_directory }}/{{ ansible_fqdn }}"
path: "{{ global_ssh_host_key_directory }}/{{ inventory_hostname }}"
state: directory
owner: "{{ global_local_user }}"
group: "{{ global_local_user }}"
@ -56,7 +56,7 @@
- name: Store ssh host keys locally
copy:
content: "{{ item.stdout }}\n"
dest: "{{ global_ssh_host_key_directory }}/{{ ansible_fqdn }}/{{ item.item }}"
dest: "{{ global_ssh_host_key_directory }}/{{ inventory_hostname }}/{{ item.item }}"
owner: "{{ global_local_user }}"
group: "{{ global_local_user }}"
mode: "u=rw,g=r,o=r"
@ -67,7 +67,7 @@
- name: Generate ssh host key dns fingerprints locally
make:
chdir: "{{ global_ssh_host_key_directory }}/{{ ansible_fqdn }}"
chdir: "{{ global_ssh_host_key_directory }}/{{ inventory_hostname }}"
file: "{{ playbook_dir }}/helpers/ssh_dns_fingerprints.makefile"
target: dns
delegate_to: localhost

@ -47,7 +47,7 @@
- name: Disable public root user access
mysql_user:
user: "root"
host: "{{ ansible_fqdn }}"
host: "{{ inventory_hostname }}"
state: absent
login_unix_socket: /var/run/mysqld/mysqld.sock

@ -57,7 +57,7 @@
- name: Configure test file for validation directory
copy:
content: "{{ ansible_fqdn }}"
content: "{{ inventory_hostname }}"
dest: "{{ nginx_validation_test_file }}"
owner: root
group: root

Loading…
Cancel
Save