-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create main.yml * Fix lint errors * Fix lint errors * Fix lint errors * Fix lint errors * Fix lint errors * Fix lint errors * Change github action * Change github action
- Loading branch information
Showing
6 changed files
with
49 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Ansible | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install ansible | ||
run: | | ||
sudo apt install software-properties-common | ||
sudo add-apt-repository --yes --update ppa:ansible/ansible | ||
sudo apt install ansible | ||
# Check syntax for all ansible playbooks | ||
- name: Validate all playbooks | ||
run: ansible-playbook ansible/*.yml --syntax-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
--- | ||
- name: Configure unattended-upgrades | ||
hosts: all | ||
become: yes | ||
become: true | ||
tasks: | ||
- name: Install unattended-upgrades | ||
apt: | ||
ansible.builtin.apt: | ||
pkg: "unattended-upgrades" | ||
state: "present" | ||
|
||
# ref. https://wiki.debian.org/UnattendedUpgrades | ||
- name: Create apt file that would be made by interactive dpkg-reconfigure | ||
file: | ||
ansible.builtin.file: | ||
path: "/etc/apt/apt.conf.d/20auto-upgrades" | ||
owner: "root" | ||
group: "root" | ||
mode: "0644" | ||
state: "touch" | ||
- name: "Populate 20auto-upgrades apt file" | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
dest: "/etc/apt/apt.conf.d/20auto-upgrades" | ||
line: '{{item}}' | ||
line: '{{ item }}' | ||
with_items: | ||
- 'APT::Periodic::Update-Package-Lists "1";' | ||
- 'APT::Periodic::Unattended-Upgrade "1";' | ||
|
||
# ref. https://help.ubuntu.com/community/Lubuntu/Documentation/RemoveOldKernels#Shell | ||
- name: Enable remove unused deps in /etc/apt/apt.conf.d/50unattended-upgrades | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
dest: "/etc/apt/apt.conf.d/50unattended-upgrades" | ||
line: 'Unattended-Upgrade::Remove-Unused-Dependencies "true";' | ||
insertafter: '^//Unattended-Upgrade::Remove-Unused-Dependencies' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters