Skip to content

Commit

Permalink
Make it possible to remove default configuration (files)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdriel committed Jan 19, 2022
1 parent 7955e64 commit 078ddb2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Manage packages and up(date|grade)s in Debian-like systems.
* `apt_remove_purge`: [default: `false`]: Whether or not to purge

* `apt_etc_apt_apt_conf`: [default: `[]`]: List of lines to be added to `/etc/apt/apt.conf`
* `apt_etc_apt_apt_conf_d_files_absent`: [default: `[]`]: List of files to be removed from `/etc/apt/apt.conf.d`

## Dependencies

Expand All @@ -63,6 +64,8 @@ None
Fix-Broken "true";
};
};
apt_etc_apt_apt_conf_d_files_absent:
- 20auto-upgrades
```
#### License
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ apt_remove: []
apt_remove_purge: false

apt_etc_apt_apt_conf: []
apt_etc_apt_apt_conf_d_files_absent: []
10 changes: 10 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
- apt
- apt-configuration

- name: remove configuration files - /etc/apt/apt.conf.d/*
file:
path: "/etc/apt/apt.conf.d/{{ item }}"
state: absent
with_items: "{{ apt_etc_apt_apt_conf_d_files_absent }}"
tags:
- configuration
- apt
- apt-configuration

- name: ensure directory exists - /var/lib/apt/lists/
file:
path: /var/lib/apt/lists/
Expand Down

0 comments on commit 078ddb2

Please sign in to comment.