state: restarted
#+END_SRC
-** Hard-wire Important IP Addresses
+** Set Domain Name
-For the edification of programs consulting the =/etc/hosts= file, the
-institute's domain name and public IP address are added. The Debian
-custom of translating the host name into ~127.0.1.1~ is also followed.
+The host's fully qualified (private) domain name (FQDN) is set by an
+alias in its =/etc/hosts= file, as is customary on Debian. (See "The
+"recommended method of setting the FQDN" in the ~hostname(1)~
+manpage.)
#+CAPTION: [[file:roles_t/campus/tasks/main.yml][=roles_t/campus/tasks/main.yml=]]
#+BEGIN_SRC conf :tangle roles_t/campus/tasks/main.yml
-- name: Hard-wire important IP addresses.
+- name: Set domain name.
become: yes
- lineinfile:
- path: /etc/hosts
- regexp: "{{ item.regexp }}"
- line: "{{ item.line }}"
- insertafter: EOF
vars:
name: "{{ inventory_hostname }}"
- loop:
- - regexp: "^{{ front_addr }}[ ].*"
- line: "{{ front_addr }} {{ domain_name }}"
- - regexp: "^127.0.1.1[ ].*"
- line: "127.0.1.1 {{ name }}.localdomain {{ name }}"
+ lineinfile:
+ path: /etc/hosts
+ regexp: "^127.0.1.1[ ].*"
+ line: "127.0.1.1 {{ name }}.{{ domain_priv }} {{ name }}"
#+END_SRC
** Configure NRPE
enabled: yes
state: started
-- name: Hard-wire important IP addresses.
+- name: Set domain name.
become: yes
- lineinfile:
- path: /etc/hosts
- regexp: "{{ item.regexp }}"
- line: "{{ item.line }}"
- insertafter: EOF
vars:
name: "{{ inventory_hostname }}"
- loop:
- - regexp: "^{{ front_addr }}[ ].*"
- line: "{{ front_addr }} {{ domain_name }}"
- - regexp: "^127.0.1.1[ ].*"
- line: "127.0.1.1 {{ name }}.localdomain {{ name }}"
+ lineinfile:
+ path: /etc/hosts
+ regexp: "^127.0.1.1[ ].*"
+ line: "127.0.1.1 {{ name }}.{{ domain_priv }} {{ name }}"
- name: Install NRPE.
become: yes