created major large-scale changes
This commit is contained in:
@@ -1,13 +1,34 @@
|
||||
- name: Initialize homeserver
|
||||
hosts: "{{ chosen_host | default('armitage') }}"
|
||||
hosts: "{{ chosen_host | default('staging1.test') }}"
|
||||
remote_user: "{{ chosen_user | default('senpai') }}"
|
||||
vars_files:
|
||||
- vars/email_settings.yml
|
||||
- vars/podpose_settings.yml # REQUIRED
|
||||
- vars/source_code.yml # REQUIRED
|
||||
- vars/caddy_settings.yml
|
||||
- vars/certbot_settings@homeserver.yml # REQUIRED
|
||||
- vars/mysql_settings.yml
|
||||
- vars/redis_settings.yml
|
||||
- vars/nextcloud_settings.yml
|
||||
- vars/gitea_settings.yml
|
||||
- vars/opengist_settings.yml
|
||||
- vars/vpn_settings.yml
|
||||
- vars/headscale_settings.yml
|
||||
- vars/tailscale_settings.yml
|
||||
- vars/glance_settings.yml
|
||||
- vars/surge_settings.yml
|
||||
- vars/aria_settings.yml
|
||||
- vars/flexget_settings.yml # REQUIRED
|
||||
- vars/git_aliases.yml # REQUIRED
|
||||
- vars/sox_prox.yml # REQUIRED
|
||||
- vars/flexget_dls.yml # REQUIRED
|
||||
- vars/aria_api.yml # REQUIRED
|
||||
- vars/vim_settings.yml # REQUIRED
|
||||
- vars/tor_settings.yml # REQUIRED
|
||||
- vars/config@{{ inventory_hostname | default('homeserver') }}.yml
|
||||
tasks:
|
||||
- name: Saving HTTP/(S)FTP credentials
|
||||
ansible.builtin.include_role:
|
||||
name: init-server
|
||||
tasks_from: netrc.yml
|
||||
handlers_from: userspace
|
||||
- name: Installing requisite packages
|
||||
ansible.builtin.include_role:
|
||||
name: init-server
|
||||
@@ -39,19 +60,19 @@
|
||||
- disable_root_login
|
||||
- name: Reorganizing userspace package groups into single list
|
||||
ansible.builtin.set_fact:
|
||||
all_userspace_pkgs: "{{ pkgs | dict2items(key_name='pkg_group', value_name='pkgs') | map(attribute='pkgs') | list | map(attribute='userspace') | list | flatten }}"
|
||||
all_userspace_pkgs: "{{ pkgs | dict2items(key_name='pkg_group', value_name='pkgs') | map(attribute='pkgs') | list | map(attribute='userspace', default='no_userspace') | list | flatten | reject('search', 'no_userspace') | list }}"
|
||||
- name: Reorganizing core package groups into single list
|
||||
ansible.builtin.set_fact:
|
||||
all_core_pkgs: "{{ pkgs | dict2items(key_name='pkg_group', value_name='pkgs') | map(attribute='pkgs') | list | map(attribute='core') | list | flatten }}"
|
||||
all_core_pkgs: "{{ pkgs | dict2items(key_name='pkg_group', value_name='pkgs') | map(attribute='pkgs') | list | map(attribute='core', default='no_core') | list | flatten | reject('search', 'no_core') | list }}"
|
||||
- name: Configuring aliases for using git
|
||||
when: "'git' in all_core_pkgs"
|
||||
when: "'git' in all_core_pkgs or 'git' in all_userspace_pkgs"
|
||||
community.general.git_config:
|
||||
name: "alias.{{ item[0] }}"
|
||||
scope: global
|
||||
value: "{{ item[1] }}"
|
||||
loop: "{{ git_aliases }}"
|
||||
- name: Checking presence of dependency for flexget
|
||||
when: "'uv' in all_core_pkgs"
|
||||
when: "'uv' in all_core_pkgs and flexget.enabled"
|
||||
block:
|
||||
- name: Installing flexget
|
||||
become: true
|
||||
@@ -139,6 +160,7 @@
|
||||
group: "{{ ansible_user }}"
|
||||
force: true
|
||||
backup: true
|
||||
# validate: "flexget check"
|
||||
- name: Creating a CRON job for flexget
|
||||
ansible.builtin.cron:
|
||||
name: Run flexget
|
||||
@@ -146,3 +168,39 @@
|
||||
hour: "4-15"
|
||||
weekday: "1-5"
|
||||
job: "{{ ansible_user_home.stdout }}/.local/bin/flexget --cron execute"
|
||||
- name: Opening port 51820
|
||||
become: true
|
||||
ansible.builtin.iptables:
|
||||
chain: INPUT
|
||||
protocol: "{{ item }}"
|
||||
destination_port: 51820
|
||||
jump: ACCEPT
|
||||
comment: Open up port 51820
|
||||
loop:
|
||||
- udp
|
||||
- tcp
|
||||
- name: Opening port 443
|
||||
become: true
|
||||
ansible.builtin.iptables:
|
||||
chain: INPUT
|
||||
protocol: "{{ item }}"
|
||||
destination_port: 443
|
||||
jump: ACCEPT
|
||||
comment: Open up port 443
|
||||
loop:
|
||||
- udp
|
||||
- tcp
|
||||
- name: Opening ports
|
||||
become: true
|
||||
ansible.builtin.iptables:
|
||||
chain: INPUT
|
||||
protocol: tcp
|
||||
destination_port: "{{ item }}"
|
||||
jump: ACCEPT
|
||||
comment: "Open up port {{ (item | string) }}"
|
||||
loop:
|
||||
- 80
|
||||
- 465
|
||||
- 587
|
||||
- 995
|
||||
- 993
|
||||
Reference in New Issue
Block a user