Files
sukaato-ansible/install@vps.yml

59 lines
1.9 KiB
YAML

---
- name: Install packages
hosts: vps
gather_facts: yes
vars:
# # below is just to remind you to use '-u' instead
# ansible_user: "{{ admin_auths[0].username }}"
# # below is just to remind you to use '--ask-pass' instead
# ansible_password: "{{ admin_auths[0].password }}"
FAMILY: "{{ ansible_facts['os_family'] }}"
CORE_PKGS: "core_pkgs@{{ ansible_facts['os_family'] }}.yml"
want_extra_pkgs: no
porkbun_certbot_plugin: yes
tasks:
- name: Install core packages
become: yes
become_method: sudo
block:
- name: Install native packages
include_role:
name: bootstrap
tasks_from: "core_installations.yml"
defaults_from: "{{ CORE_PKGS }}"
tags: ['native_pkgs']
- name: Install foreign packages
include_role:
name: bootstrap
tasks_from: "core_installations@{{ FAMILY }}.yml"
defaults_from: "{{ CORE_PKGS }}"
handlers_from: "update@{{ family }}.yml"
tags: ['foreign_pkgs']
register: core_done
tags: ['default', 'core']
- name: Install additional packages
become: yes
become_method: sudo
include_role:
tasks_from: extra_installations.yml
defaults_from: "custom_pkgs@{{ FAMILY }}.yml"
register: extra_pkgs_done
when: want_extra_pkgs
tags: ['default', 'extra_pkgs']
- name: Install a Porkbun API plugin for Certbot
become: yes
become_method: sudo
pip:
name: 'git+https://github.com/infinityofspace/certbot_dns_porkbun.git'
state: present
when: porkbun_certbot_plugin
tags: ['default', 'with_porkbun_api']
- name: Get ftpasswd utility for ProFTPd
become: yes
become_method: sudo
get_url:
url: http://www.castaglia.org/proftpd/contrib/ftpasswd
dest: /usr/local/bin/ftpasswd
mode: "0755"
tags: ['default', 'with_ftp']