Browse Source

Fixed remaining syntax errors and added example var files

Signed-off-by: Jim Martens <github@2martens.de>
master
Jim Martens 2 years ago
parent
commit
20e31b32e0
  1. 4
      .gitignore
  2. 7
      collabora.yml
  3. 4
      collabora_vars.yml.example
  4. 25
      initial-setup.yml
  5. 5
      initial_vars.yml.example
  6. 2
      roles/apache/tasks/main.yml
  7. 2
      roles/collabora/defaults/main.yml
  8. 2
      roles/collabora/tasks/apache.yml
  9. 4
      roles/collabora/tasks/collabora.yml
  10. 1
      roles/common/defaults/main.yml
  11. 10
      roles/common/tasks/apticron.yml
  12. 10
      roles/common/tasks/main.yml

4
.gitignore

@ -1,3 +1,5 @@
# ---> Ansible
*.retry
hosts
initial_vars.yml
collabora_vars.yml

7
collabora.yml

@ -1,12 +1,11 @@
---
- name: Set up Collabora Online
hosts: vps
vars:
ssh_user: ssh_login
vars_files:
- collabora_vars.yml
remote_user: "{{ ssh_user }}"
become: yes
become_user: root
become_method: su
gather_facts: no
roles:
- collabora

4
collabora_vars.yml.example

@ -0,0 +1,4 @@
---
admin_mail: admin@example.com
ssh_user: ssh_login
nextcloud_domain: nextcloud.com

25
initial-setup.yml

@ -4,25 +4,8 @@
port: 22
remote_user: root
hosts: vps
vars:
- ssh_user: ssh_login
vars_prompt:
- name: new_root_pw
prompt: "What should be the new root password?"
private: yes
encrypt: "sha512_crypt"
confirm: yes
salt_size: 7
- name: new_user_password
prompt: "Password of the SSH login user"
private: yes
encrypt: "sha512_crypt"
confirm: yes
salt_size: 7
- name: ssh_key
prompt: "public SSH key file location for new SSH login user"
private: no
vars_files:
- initial_vars.yml
tasks:
- name: update the package list
apt:
@ -35,11 +18,11 @@
- name: updates password of root user
user:
name: root
password: {{ new_root_pw }}
password: {{ new_root_pw | password_hash('sha512') }}
- name: create ssh login user
user:
name: {{ ssh_user }}
password: {{ new_user_password }}
password: {{ new_user_password | password_hash('sha512') }}
append: yes
groups:
- sudo

5
initial_vars.yml.example

@ -0,0 +1,5 @@
---
new_root_pw: newStrongRootPW
new_user_password: newStringUserPW
ssh_key: ~/.ssh/id_ed25519.pub
ssh_user: ssh_login

2
roles/apache/tasks/main.yml

@ -24,4 +24,4 @@
- name: enable ssl
command:
cmd: a2enmod ssl
notify: restart apache
notify: restart apache

2
roles/collabora/defaults/main.yml

@ -0,0 +1,2 @@
---
nextcloud_domain: nextcloud.com

2
roles/collabora/tasks/apache.yml

@ -14,7 +14,7 @@
- name: enable collabora site
command:
cmd: a2ensite {{ ansible_domain }}.conf
notify: reload apache
notify: reload apache
- name: run certbot
command:
cmd: certbot --apache --non-interactive --keep-until-expiring --no-eff-email --redirect --renew-with-new-domains --agree-tos -d {{ ansible_domain }}

4
roles/collabora/tasks/collabora.yml

@ -6,9 +6,5 @@
owner: root
group: root
mode: 0644
vars_prompt:
- name: nextcloud_domain
prompt: "Nextcloud domain"
private: no
- name: start collabora docker container
command: docker-compose --project-directory /etc/collabora up -d

1
roles/common/defaults/main.yml

@ -2,4 +2,5 @@
sshport: 22
openports_list:
- 22
admin_mail: admin@example.com
#blacklist_ip_list:

10
roles/common/tasks/apticron.yml

@ -1,13 +1,10 @@
---
- name: ensure apticron packages are installed
apt:
pkg: "{{ packages }}"
name: apticron
state: latest
update_cache: yes
cache_valid_time: 600
vars:
packages:
- apticron
- name: configure apticron
template:
@ -16,8 +13,3 @@
owner: root
group: root
mode: 0644
vars_prompt:
- name: admin_mail
prompt: "Mail of server admin"
private: no

10
roles/common/tasks/main.yml

@ -1,17 +1,7 @@
---
- include: apt.yml
tags:
- apt
- include: apticron.yml
tags:
- apticron
- include: disk-check.yml
tags:
- disk
- include: ufw.yml
tags:
- firewall
- include: fail2ban.yml
tags:
- firewall
- include: tools.yml

Loading…
Cancel
Save