2
0
mirror of https://github.com/schnidrig/openhab-ansible synced 2026-01-12 00:48:46 +01:00

initial commit

This commit is contained in:
Christian Schnidrig
2016-11-29 00:08:10 +01:00
parent 8643000910
commit 3a665afb54
30 changed files with 533 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
---
- name: setup /etc/locale.gen
lineinfile:
dest: "/etc/locale.gen"
regexp: '\s*#\s*({{locale}}.*)'
line: '\1'
backrefs: yes
tags:
- locale
- name: generate locale
locale_gen: name="{{locale}}" state=present
tags:
- locale
- name: set environment file
template:
src: environment
dest: "/etc/environment"
owner: root
group: root
mode: "u=rw,g=r,o=r"
tags:
- locale

View File

@@ -0,0 +1,9 @@
---
- include: packages.yml
- include: ntp.yml
- include: timezone.yml
- include: locale.yml

View File

@@ -0,0 +1,28 @@
---
- name: update ntp.conf
lineinfile:
dest=/etc/ntp.conf
regexp="^server\s+.*debian.pool.ntp.org.*"
insertafter="^server\s.*"
state=absent
notify: restart ntp
tags:
- ntp
- ntpconfig
- name: update ntp.conf
lineinfile:
dest=/etc/ntp.conf
insertafter="# pool:"
line="server {{item}} iburst"
with_items: "{{ntp}}"
notify: restart ntp
tags:
- ntp
- ntpconfig
- name: Start the ntp service
service: name=ntp state=started enabled=true
tags: ntp

View File

@@ -0,0 +1,16 @@
---
- name: ensure packages are installed
apt:
pkg: "{{item}}"
update_cache: "{{apt_config.update_cache}}"
cache_valid_time: "{{apt_config.cache_valid_time}}"
with_items:
- apt-transport-https
- ntp
- tmux
- python-pip
- git
tags:
- packages

View File

@@ -0,0 +1,22 @@
---
- name: fix /etc/localtime
file:
state: link
path: "/etc/localtime"
src: "/usr/share/zoneinfo/{{timezone}}"
owner: root
group: root
force: true
tags:
- timezone
- name: fix /etc/timezone
copy:
dest: "/etc/timezone"
content: "{{timezone}}"
owner: root
group: root
mode: "u=rw,g=r,o=r"
tags:
- timezone