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
|
||||
connection: local
|
||||
|
||||
- name: Include all .json and .jsn files in vars/all and all nested directories (2.3)
|
||||
- name: Include variables
|
||||
include_vars:
|
||||
file: "variables.yml"
|
||||
|
||||
|
@ -13,6 +13,18 @@
|
|||
# - testuser
|
||||
|
||||
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
|
||||
timezone:
|
||||
name: Europe/Rome
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
- name: Include variables
|
||||
include_vars:
|
||||
file: "../../../variables.yml"
|
||||
|
||||
- name: create tincvpn folder
|
||||
file:
|
||||
path: /etc/tinc/{{ tinc_vpn }}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
users:
|
||||
- commonuser
|
||||
tinc_vpn: vpn
|
||||
hostname: common_hostname
|
||||
|
|
Loading…
Reference in a new issue