add hostname

This commit is contained in:
panda 2020-03-14 00:24:47 +01:00
parent bc6e259aad
commit e27c8503b3
3 changed files with 18 additions and 1 deletions

View file

@ -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

View file

@ -1,3 +1,7 @@
- name: Include variables
include_vars:
file: "../../../variables.yml"
- name: create tincvpn folder
file:
path: /etc/tinc/{{ tinc_vpn }}

View file

@ -1,3 +1,4 @@
users:
- commonuser
tinc_vpn: vpn
hostname: common_hostname