back to singular

This commit is contained in:
2022-09-24 20:55:50 +02:00
parent 0e20f83a67
commit dd00b2840a
60 changed files with 51 additions and 51 deletions

View File

@@ -0,0 +1,4 @@
- include_tasks: nextcloud/nextcloud.yml
when:
- nextcloud is defined
- nextcloud == True

View File

@@ -0,0 +1,20 @@
- include_vars: nextcloud.yml
- import_tasks: apps/nextcloud/prereq.yml
- name: webserver | nextcloud | get tar ball
uri:
url: "https://download.nextcloud.com/server/releases/latest.zip"
dest: "/tmp/nextcloud_latest.zip"
follow_redirects: all
- name: webserver | nextcloud | extract archive
unarchive:
src: "/tmp/nextcloud_latest.zip"
dest: "/var/www/"
owner: "{{ webuser }}"
group: "{{ webuser }}"
- name: webserver | nextcloud | remove temporary file
file:
path: "/tmp/nextcloud_latest.zip"
state: absent

View File

@@ -0,0 +1,29 @@
- name: webserver | nextcloud | basic tools
package:
state: latest
name:
- ca-certificates
- apt-transport-https
- software-properties-common
- lsb-release
- ca-certificates
when: ansible_distribution in ["Debian", "Ubuntu"]
- name: webserver | nextcloud | prereq | get php repo key
uri:
url: "https://packages.sury.org/php/apt.gpg"
dest: "/etc/apt/trusted.gpg.d/php.gpg"
- name: webserver | nextcloud | prereq | add php repo
lineinfile:
path: "/etc/apt/sources.list.d/php.list"
state: present
line: "deb https://packages.sury.org/php/ {{ ansible_distribution_release | lower }} main"
create: True
- name: webserver | nextcloud | prereq | install php
package:
state: latest
name: "{{ item.package }}"
update_cache: True
with_items: "{{ nextcloud_php_packages }}"

View File

@@ -0,0 +1,15 @@
- name: webserver | snmpd | get script
get_url:
url: "https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/nginx"
dest: "/etc/snmp/nginx"
mode: "0755"
owner: "root"
group: "root"
- name: webserver | snmpd | configure extend
lineinfile:
path: "{{ snmpd_conf }}"
state: present
line: "extend nginx /etc/snmp/nginx"
insertafter: "# SECTION: custom settings"
notify: restart_snmpd

View File

@@ -0,0 +1,18 @@
- name: webserver | apache | installing apache
package:
name: "{{ apache_package }}"
state: latest
# - name: webserver | apache | setup localhost for statistics
# copy:
# src: "apache_localhost"
# dest: "/etc/apache/sites-available/localhost"
# - name: webserver | apache | link sites-available to sites-enabled for localhost
# file:
# path: "/etc/apache/sites-enabled/localhost"
# state: link
# src: "/etc/apache/sites-available/localhost"
# notify: restart_apache
# - include_tasks: configure_apache_snmpd.yml

View File

@@ -0,0 +1,18 @@
- name: webserver | nginx | installing nginx
package:
name: "{{ nginx_package }}"
state: latest
- name: webserver | nginx | setup localhost for statistics
copy:
src: "nginx_localhost"
dest: "/etc/nginx/sites-available/localhost"
- name: webserver | nginx | link sites-available to sites-enabled for localhost
file:
path: "/etc/nginx/sites-enabled/localhost"
state: link
src: "/etc/nginx/sites-available/localhost"
notify: restart_nginx
- include_tasks: configure_nginx_snmpd.yml

View File

@@ -0,0 +1,6 @@
- name: webserver | apache | installing php
package:
name:
- php
- php-mysqli
state: latest

View File

@@ -0,0 +1,22 @@
# Load distro-specific variables
- include_vars: "{{ ansible_distribution }}.yml"
tags: always
- block:
- debug:
msg: Debug
# install software
- import_tasks: install_apache.yml
when:
- apache is defined
- apache == true
- import_tasks: install_nginx.yml
when:
- nginx is defined
- nginx == true
- import_tasks: install_php.yml
- name: webserver | certbot | install certbot
package:
name: certbot
state: latest
- include_tasks: apps/apps.yml