add hostname
This commit is contained in:
parent
bc6e259aad
commit
e27c8503b3
3 changed files with 18 additions and 1 deletions
14
common.yml
14
common.yml
|
@ -4,7 +4,7 @@
|
||||||
hosts: thismachine
|
hosts: thismachine
|
||||||
connection: local
|
connection: local
|
||||||
|
|
||||||
- name: Include all .json and .jsn files in vars/all and all nested directories (2.3)
|
- name: Include variables
|
||||||
include_vars:
|
include_vars:
|
||||||
file: "variables.yml"
|
file: "variables.yml"
|
||||||
|
|
||||||
|
@ -13,6 +13,18 @@
|
||||||
# - testuser
|
# - testuser
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: change hostname to myserver
|
||||||
|
hostname:
|
||||||
|
name: {{ hostname }}
|
||||||
|
|
||||||
|
- name: add myself to /etc/hosts
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/hosts
|
||||||
|
regexp: '^127\.0\.0\.1[ \t]+localhost'
|
||||||
|
line: '127.0.0.1 localhost {{ hostname }}'
|
||||||
|
state: present
|
||||||
|
|
||||||
|
|
||||||
- name: Set timezone to Europe/Rome
|
- name: Set timezone to Europe/Rome
|
||||||
timezone:
|
timezone:
|
||||||
name: Europe/Rome
|
name: Europe/Rome
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
- name: Include variables
|
||||||
|
include_vars:
|
||||||
|
file: "../../../variables.yml"
|
||||||
|
|
||||||
- name: create tincvpn folder
|
- name: create tincvpn folder
|
||||||
file:
|
file:
|
||||||
path: /etc/tinc/{{ tinc_vpn }}
|
path: /etc/tinc/{{ tinc_vpn }}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
users:
|
users:
|
||||||
- commonuser
|
- commonuser
|
||||||
tinc_vpn: vpn
|
tinc_vpn: vpn
|
||||||
|
hostname: common_hostname
|
||||||
|
|
Loading…
Reference in a new issue