Initial commit
This commit is contained in:
65
roles/weareinteractive.apt/tasks/config.yml
Executable file
65
roles/weareinteractive.apt/tasks/config.yml
Executable file
@@ -0,0 +1,65 @@
|
||||
---
|
||||
|
||||
- name: Configuring APT
|
||||
template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "/{{ item }}"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- "etc/apt/apt.conf.d/10general"
|
||||
- "etc/apt/apt.conf.d/10periodic"
|
||||
|
||||
- name: Configuring APT
|
||||
template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "/{{ item }}"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
when: apt_unattended_upgrades | bool
|
||||
with_items:
|
||||
- "etc/apt/apt.conf.d/50unattended-upgrades"
|
||||
|
||||
- name: Configuring APT Download timer
|
||||
include_tasks: unattended_upgrades_download_timer.yml
|
||||
when: apt_unattended_upgrades_download_timer_override is not none
|
||||
|
||||
- name: Configuring APT Upgrade timer
|
||||
include_tasks: unattended_upgrades_upgrade_timer.yml
|
||||
when: apt_unattended_upgrades_upgrade_timer_override is not none
|
||||
|
||||
- name: Configuring remount filesystems
|
||||
template:
|
||||
src: "etc/apt/apt.conf.d/10remount_{{ item }}.j2"
|
||||
dest: "/etc/apt/apt.conf.d/10remount_{{ item }}"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
when: apt_remount_filesystems | bool
|
||||
with_items:
|
||||
- "{{ apt_remount_filesystems }}"
|
||||
|
||||
- name: Configuring APT proxy behavior
|
||||
template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "/{{ item }}"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
when: apt_http_proxy_address is defined or apt_https_proxy_address is defined
|
||||
with_items:
|
||||
- "etc/apt/apt.conf.d/00proxy"
|
||||
|
||||
- name: Alter Aptitude solution costs
|
||||
template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "/{{ item }}"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
when: apt_aptitude_solution_cost | bool
|
||||
with_items:
|
||||
- "etc/apt/apt.conf.d/20alter-aptitude-solution-cost"
|
||||
|
||||
7
roles/weareinteractive.apt/tasks/debs.yml
Executable file
7
roles/weareinteractive.apt/tasks/debs.yml
Executable file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Installing .deb packages
|
||||
apt:
|
||||
deb: "{{ item }}"
|
||||
autoremove: "{{ apt_autoremove }}"
|
||||
with_items: "{{ apt_deb_packages }}"
|
||||
11
roles/weareinteractive.apt/tasks/dependencies.yml
Executable file
11
roles/weareinteractive.apt/tasks/dependencies.yml
Executable file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
|
||||
- name: Installing required packages
|
||||
apt:
|
||||
name: "{{ packages }}"
|
||||
state: present
|
||||
vars:
|
||||
packages:
|
||||
- aptitude
|
||||
- python-apt
|
||||
- python-pycurl
|
||||
6
roles/weareinteractive.apt/tasks/install.yml
Executable file
6
roles/weareinteractive.apt/tasks/install.yml
Executable file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
|
||||
- include_tasks: update.yml
|
||||
- include_tasks: upgrade.yml
|
||||
- include_tasks: dependencies.yml
|
||||
- include_tasks: unattended_upgrades.yml
|
||||
13
roles/weareinteractive.apt/tasks/keys.yml
Executable file
13
roles/weareinteractive.apt/tasks/keys.yml
Executable file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
|
||||
- name: Adding apt signing key
|
||||
apt_key:
|
||||
id: "{{ item.id | default(omit) }}"
|
||||
file: "{{ item.file | default(omit) }}"
|
||||
data: "{{ item.data | default(omit) }}"
|
||||
keyring: "{{ item.keyring | default(omit) }}"
|
||||
keyserver: "{{ item.keyserver | default(omit) }}"
|
||||
url: "{{ item.url | default(omit) }}"
|
||||
validate_certs: "{{ item.validate_certs | default(omit) }}"
|
||||
state: "{{ item.state | default('present') }}"
|
||||
with_items: "{{ apt_keys }}"
|
||||
22
roles/weareinteractive.apt/tasks/main.yml
Executable file
22
roles/weareinteractive.apt/tasks/main.yml
Executable file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
|
||||
- import_tasks: config.yml
|
||||
tags:
|
||||
- system
|
||||
- apt
|
||||
- config
|
||||
- apt-config
|
||||
|
||||
- import_tasks: install.yml
|
||||
tags:
|
||||
- system
|
||||
- apt
|
||||
- install
|
||||
- apt-install
|
||||
|
||||
- import_tasks: manage.yml
|
||||
tags:
|
||||
- system
|
||||
- apt
|
||||
- manage
|
||||
- apt-manage
|
||||
7
roles/weareinteractive.apt/tasks/manage.yml
Executable file
7
roles/weareinteractive.apt/tasks/manage.yml
Executable file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
|
||||
- include_tasks: keys.yml
|
||||
- include_tasks: repositories.yml
|
||||
- include_tasks: preferences.yml
|
||||
- include_tasks: packages.yml
|
||||
- include_tasks: debs.yml
|
||||
7
roles/weareinteractive.apt/tasks/packages.yml
Executable file
7
roles/weareinteractive.apt/tasks/packages.yml
Executable file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Installing packages
|
||||
apt:
|
||||
name: "{{ apt_packages }}"
|
||||
state: present
|
||||
autoremove: "{{ apt_autoremove }}"
|
||||
10
roles/weareinteractive.apt/tasks/preferences.yml
Executable file
10
roles/weareinteractive.apt/tasks/preferences.yml
Executable file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
- name: Configuring APT preferences
|
||||
template:
|
||||
src: etc/apt/preferences.d/preferences.j2
|
||||
dest: "/etc/apt/preferences.d/{{ item.file }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
with_items: "{{ apt_preferences }}"
|
||||
11
roles/weareinteractive.apt/tasks/repositories.yml
Executable file
11
roles/weareinteractive.apt/tasks/repositories.yml
Executable file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
|
||||
- name: Adding apt repository
|
||||
apt_repository:
|
||||
codename: "{{ item.codename | default(omit) }}"
|
||||
filename: "{{ item.filename | default(omit) }}"
|
||||
mode: "{{ item.mode | default(omit) }}"
|
||||
repo: "{{ item.repo | default(omit) }}"
|
||||
state: "{{ item.state | default(omit) }}"
|
||||
update_cache: "{{ item.update_cache | default('yes') }}"
|
||||
with_items: "{{ apt_repositories }}"
|
||||
7
roles/weareinteractive.apt/tasks/unattended_upgrades.yml
Executable file
7
roles/weareinteractive.apt/tasks/unattended_upgrades.yml
Executable file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Installing packages
|
||||
apt:
|
||||
pkg: "unattended-upgrades"
|
||||
state: "{{ 'latest' if apt_unattended_upgrades else 'absent' }}"
|
||||
when: apt_unattended_upgrades | bool
|
||||
20
roles/weareinteractive.apt/tasks/unattended_upgrades_download_timer.yml
Executable file
20
roles/weareinteractive.apt/tasks/unattended_upgrades_download_timer.yml
Executable file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
|
||||
- name: Creating Download timer directory
|
||||
file:
|
||||
path: "/etc/systemd/system/apt-daily.timer.d"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
|
||||
- name: Configuring Download timer
|
||||
template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "/{{ item }}"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- "etc/systemd/system/apt-daily.timer.d/override.conf"
|
||||
notify: reload systemd
|
||||
20
roles/weareinteractive.apt/tasks/unattended_upgrades_upgrade_timer.yml
Executable file
20
roles/weareinteractive.apt/tasks/unattended_upgrades_upgrade_timer.yml
Executable file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
|
||||
- name: Creating Upgrade timer directory
|
||||
file:
|
||||
path: "/etc/systemd/system/apt-daily-upgrade.timer.d"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
|
||||
- name: Configuring Upgrade timer
|
||||
template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "/{{ item }}"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- "etc/systemd/system/apt-daily-upgrade.timer.d/override.conf"
|
||||
notify: reload systemd
|
||||
6
roles/weareinteractive.apt/tasks/update.yml
Executable file
6
roles/weareinteractive.apt/tasks/update.yml
Executable file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
|
||||
- name: Updating cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
cache_valid_time: "{{ apt_cache_valid_time }}"
|
||||
8
roles/weareinteractive.apt/tasks/upgrade.yml
Executable file
8
roles/weareinteractive.apt/tasks/upgrade.yml
Executable file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
- name: Upgrading system
|
||||
apt:
|
||||
upgrade: "{{ apt_upgrade }}"
|
||||
update_cache: yes
|
||||
autoremove: "{{ apt_autoremove }}"
|
||||
when: (apt_upgrade == "safe") or (apt_upgrade == "full") or (apt_upgrade == "dist")
|
||||
Reference in New Issue
Block a user