summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruvok cheetah2023-10-31 17:09:08 +0100
committeruvok cheetah2023-10-31 17:09:08 +0100
commit2dded296b1bdf4e8deff9d5eae39ca7a1c10720a (patch)
tree269ece9b4ccfc612125f61a42ae842fa4be9d4c6
parent6b47c17c6a5315be41bed6fb7a28bdbbf3dfef34 (diff)
Linting!
indentation, naming, quoting, parameters, modes
-rw-r--r--apt_proxy.yml6
-rw-r--r--fixsources.yml2
-rw-r--r--hello_world.yml12
-rw-r--r--roles/common/tasks/main.yml2
-rw-r--r--roles/dns/tasks/main.yml2
-rw-r--r--roles/router/tasks/main.yml5
-rw-r--r--roles/router/tasks/tinc.yml7
-rw-r--r--root_ls_color.yml14
-rw-r--r--router.yml8
-rw-r--r--upgrade.yml34
10 files changed, 49 insertions, 43 deletions
diff --git a/apt_proxy.yml b/apt_proxy.yml
index 6aeabe6..6b66ae0 100644
--- a/apt_proxy.yml
+++ b/apt_proxy.yml
@@ -6,6 +6,6 @@
copy:
src: files/apt_proxy.conf
dest: /etc/apt/apt.conf.d/proxy
- mode: 0640
- force: no
- backup: yes
+ mode: "0640"
+ force: false
+ backup: true
diff --git a/fixsources.yml b/fixsources.yml
index e572cb6..ab187d4 100644
--- a/fixsources.yml
+++ b/fixsources.yml
@@ -1,3 +1,4 @@
+---
- name: Fixup sources.list
hosts: internal
tasks:
@@ -13,4 +14,3 @@
regexp: "ftp.uni-bayreuth.de/debian-security"
replace: "security.debian.org/debian-security"
backup: true
-
diff --git a/hello_world.yml b/hello_world.yml
index 67b340d..66af787 100644
--- a/hello_world.yml
+++ b/hello_world.yml
@@ -1,10 +1,12 @@
+---
# To run this, name this file hello_world.yml and run the following in the same directory
# ansible-playbook hello_world.yml -i 'local,' --connection=local
-- name: hello world example
+- name: Hello world example
hosts: all
tasks:
- - name: Create a directory
- file:
- path=hello_world
- state=directory
+ - name: Create a directory
+ file:
+ path: hello_world
+ state: directory
+ mode: '0600'
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
index bf2dd00..627190f 100644
--- a/roles/common/tasks/main.yml
+++ b/roles/common/tasks/main.yml
@@ -1,5 +1,5 @@
---
-- name: install basic
+- name: Install basic
package:
name:
- rsync
diff --git a/roles/dns/tasks/main.yml b/roles/dns/tasks/main.yml
index 0a2120b..d824945 100644
--- a/roles/dns/tasks/main.yml
+++ b/roles/dns/tasks/main.yml
@@ -1,5 +1,5 @@
---
-- name: install DNS software
+- name: Install DNS software
package:
name:
- dnsmasq
diff --git a/roles/router/tasks/main.yml b/roles/router/tasks/main.yml
index ee09493..c319b4a 100644
--- a/roles/router/tasks/main.yml
+++ b/roles/router/tasks/main.yml
@@ -1,5 +1,5 @@
---
-- name: install routing software
+- name: Install routing software
package:
name:
- tinc
@@ -13,9 +13,10 @@
- tinc is defined
- tinc.configure is defined
- tinc.configure
-- name: copy munin plugin
+- name: Copy munin plugin
copy:
src: munin_bird
dest: /usr/local/share/munin/plugins/bird
+ mode: '0750'
tags:
- munin
diff --git a/roles/router/tasks/tinc.yml b/roles/router/tasks/tinc.yml
index 682fa0f..2673a59 100644
--- a/roles/router/tasks/tinc.yml
+++ b/roles/router/tasks/tinc.yml
@@ -1,21 +1,25 @@
+---
- name: Ensure tinc directory exists
ansible.builtin.file:
path: '/etc/tinc/tn_int/'
state: directory
+ mode: '0750'
- name: Install tinc.conf template
template:
src: tinc.conf.j2
dest: /etc/tinc/tn_int/tinc.conf
+ mode: '0750'
tags:
- tconfig
- name: Install tinc-up template
template:
src: tinc-up.j2
dest: /etc/tinc/tn_int/tinc-up
+ mode: '0740'
tags:
- tconfig
- name: Copy remaining files
- synchronize:
+ ansible.posix.synchronize:
src: tn_int/
dest: /etc/tinc/tn_int/
archive: false
@@ -26,7 +30,6 @@
path: "/etc/tinc/tn_int/{{ item }}"
mode: "0740"
with_items:
- - tinc-up
- tinc-down
tags:
- exec
diff --git a/root_ls_color.yml b/root_ls_color.yml
index c40232b..2eee03b 100644
--- a/root_ls_color.yml
+++ b/root_ls_color.yml
@@ -1,11 +1,11 @@
+---
- name: Make sure colorful ls
hosts: internal
gather_facts: false
tasks:
- - name: Add line
- lineinfile:
- path: ~/.bashrc
- state: present
- search_string: "alias ls='ls --color=auto'"
- line: "alias ls='ls -F --color=auto'"
-
+ - name: Add line
+ lineinfile:
+ path: ~/.bashrc
+ state: present
+ search_string: "alias ls='ls --color=auto'"
+ line: "alias ls='ls -F --color=auto'"
diff --git a/router.yml b/router.yml
index 0c6191b..4383112 100644
--- a/router.yml
+++ b/router.yml
@@ -1,6 +1,6 @@
---
-- hosts: routing
+- name: "Install Router role"
+ hosts: routing
roles:
- - role: "roles/router"
- - role: "roles/common"
-
+ - role: "router"
+ - role: "common"
diff --git a/upgrade.yml b/upgrade.yml
index 2be8cce..4beddd4 100644
--- a/upgrade.yml
+++ b/upgrade.yml
@@ -1,21 +1,21 @@
+---
- name: Upgrade packages
hosts: internal
gather_facts: false
tasks:
- - name: Update and upgrade
- apt:
- update_cache: true
- upgrade: safe
- cache_valid_time: 3600
- register: result
- - name: Dump debug result
- debug:
- var: result
- - name: Check if reboot required
- stat:
- path: /var/run/reboot-required
- register: reboot_required_file
- - name: Reboot if required
- reboot:
- when: reboot_required_file.stat.exists == true
-
+ - name: Update and upgrade
+ apt:
+ update_cache: true
+ upgrade: safe
+ cache_valid_time: 3600
+ register: result
+ - name: Dump debug result
+ debug:
+ var: result
+ - name: Check if reboot required
+ stat:
+ path: /var/run/reboot-required
+ register: reboot_required_file
+ - name: Reboot if required
+ reboot:
+ when: reboot_required_file.stat.exists