Compare commits
2 commits
a8f593d9b7
...
644d610567
Author | SHA1 | Date | |
---|---|---|---|
644d610567 | |||
8f3f72098d |
6 changed files with 50 additions and 0 deletions
7
bank.yaml
Normal file
7
bank.yaml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
- hosts: bank
|
||||
vars:
|
||||
roles:
|
||||
- common
|
||||
- bank
|
||||
|
|
@ -12,3 +12,4 @@ trusted_ranges:
|
|||
- { v: ipv6, cidr: "::1" }
|
||||
- { v: ipv6, cidr: "fe80::/10" }
|
||||
- { v: ipv6, cidr: "2a02:166b:92::/64" }
|
||||
node_exporter: no
|
||||
|
|
3
hosts
3
hosts
|
@ -1,3 +1,6 @@
|
|||
[bank]
|
||||
bank.bitlair.nl
|
||||
|
||||
[bar]
|
||||
bank-pi.bitlair.nl
|
||||
|
||||
|
|
29
roles/bank/tasks/main.yaml
Normal file
29
roles/bank/tasks/main.yaml
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
- tags: bank
|
||||
block:
|
||||
- name: Install dependencies
|
||||
apt:
|
||||
name: [ libterm-readline-gnu-perl, libcurses-ui-perl ]
|
||||
state: present
|
||||
|
||||
- name: Add user
|
||||
user:
|
||||
name: bank
|
||||
password: $6$idklol$QrOE/21LDR0vhZBAXwgA7AvnmR6Ju4ZqzAzgeazC08i2yw9kyQjgwu.uuV692iL/cyE7AteDYUxCpcorONXom. # "bank"
|
||||
home: /home/bank
|
||||
shell: /home/bank/revbank.git/revbank
|
||||
update_password: always
|
||||
|
||||
- name: Allow password auth for bank user
|
||||
blockinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
insertafter: EOF
|
||||
block: |-
|
||||
Match User bank
|
||||
PasswordAuthentication yes
|
||||
notify: reload sshd
|
||||
|
||||
- name: Clear motd
|
||||
copy:
|
||||
content: ""
|
||||
dest: /etc/motd
|
|
@ -11,3 +11,5 @@ trusted_ranges:
|
|||
network_br: off
|
||||
network_dhcp: off
|
||||
network_static: off
|
||||
|
||||
node_exporter: yes
|
||||
|
|
|
@ -3,3 +3,11 @@
|
|||
apt:
|
||||
name: prometheus-node-exporter
|
||||
state: present
|
||||
when: node_exporter
|
||||
|
||||
- name: Remove node-exporter
|
||||
apt:
|
||||
name: prometheus-node-exporter
|
||||
state: absent
|
||||
autoremove: yes
|
||||
when: not node_exporter
|
||||
|
|
Loading…
Add table
Reference in a new issue