Update APT checker
This commit is contained in:
parent
ab4ba32f58
commit
f27077bcf8
@ -7,17 +7,23 @@
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
|
# Check for package managers
|
||||||
|
- name: Check for APT installation
|
||||||
|
stat:
|
||||||
|
path: /etc/apt
|
||||||
|
register: aptfolder
|
||||||
|
|
||||||
# APT Cacher-NG Configuration
|
# APT Cacher-NG Configuration
|
||||||
- name: Add APT-Cacher-NG Configuration
|
- name: Add APT-Cacher-NG Configuration
|
||||||
copy:
|
copy:
|
||||||
content: "{{ aptcacher_config }}"
|
content: "{{ aptcacher_config }}"
|
||||||
dest: /etc/apt/apt.conf.d/proxy
|
dest: /etc/apt/apt.conf.d/proxy
|
||||||
when: "'apt' in ansible_facts.packages"
|
when: aptfolder.stat.exists
|
||||||
|
|
||||||
# Update apt package lists after adding our proxy
|
# Update apt package lists after adding our proxy
|
||||||
- name: Update apt repo package lists from cacher
|
- name: Update apt repo package lists from cacher
|
||||||
apt: update_cache=yes force_apt_get=yes cache_valid_time=3600
|
apt: update_cache=yes force_apt_get=yes cache_valid_time=3600
|
||||||
when: "'apt' in ansible_facts.packages"
|
when: aptfolder.stat.exists
|
||||||
|
|
||||||
# User account (ansible) configuration
|
# User account (ansible) configuration
|
||||||
- name: Add deployment user.
|
- name: Add deployment user.
|
||||||
@ -125,4 +131,4 @@
|
|||||||
# Upgrade all apt packages for good measure.
|
# Upgrade all apt packages for good measure.
|
||||||
- name: Upgrade all apt packages
|
- name: Upgrade all apt packages
|
||||||
apt: upgrade=dist force_apt_get=yes
|
apt: upgrade=dist force_apt_get=yes
|
||||||
when: "'apt' in ansible_facts.packages"
|
when: aptfolder.stat.exists
|
Loading…
x
Reference in New Issue
Block a user