Commit | Line | Data |
---|---|---|
3ea0152b | 1 | --- |
289cc9cb MJ |
2 | - name: Add LTTng-CI PPA |
3 | when: ansible_distribution == 'Ubuntu' | |
4 | block: | |
5 | - name: LTTng-CI PPA | apt key | |
6 | ansible.builtin.copy: | |
7 | src: efficios_ubuntu_ci.gpg | |
8 | dest: /etc/apt/trusted.gpg.d/efficios_ubuntu_ci.gpg | |
9 | owner: root | |
10 | group: root | |
11 | mode: '0644' | |
12 | ||
13 | - name: LTTng-CI PPA | apt source | |
14 | ansible.builtin.apt_repository: | |
15 | repo: "deb [signed-by=/etc/apt/trusted.gpg.d/efficios_ubuntu_ci.gpg] http://ppa.launchpad.net/efficios/ci/ubuntu {{ ansible_distribution_release }} main" | |
16 | state: present | |
17 | filename: efficios-ubuntu-ci | |
18 | ||
3ea0152b MJ |
19 | - name: Update apt cache. |
20 | apt: update_cache=yes cache_valid_time=86400 | |
21 | ||
22 | - name: Ensure common packages are installed. | |
858e2403 | 23 | apt: "name={{ common_packages }} state=present" |
da439306 KS |
24 | |
25 | - name: Install unattended upgrades | |
26 | apt: | |
27 | name: 'unattended-upgrades' | |
28 | state: "{{(unattended_upgrades|bool)|ternary('present', 'absent')}}" | |
29 | ||
30 | - name: Enable extra repos for unattended upgrades | |
31 | template: | |
32 | dest: /etc/apt/apt.conf.d/51unattended_upgrades_extra_repos.conf | |
33 | src: unattended_upgrades_extra_repos.conf.j2 | |
34 | vars: | |
35 | repos_base: | |
36 | - "${distro_id}:${distro_codename}-updates" | |
37 | - "${distro_id}:${distro_codename}-backports" | |
38 | repos_Ubuntu: | |
39 | - "LP-PPA-efficios-ci:${distro_codename}" | |
40 | repose_Debian: [] | |
41 | repos: "{{repos_base|union(lookup('vars', 'repos_' + ansible_distribution, default=[]))}}" | |
42 | ||
43 | - name: Enable unattended upgrades | |
44 | block: | |
45 | - copy: | |
46 | dest: /etc/apt/apt.conf.d/20auto-upgrades | |
47 | content: "APT::Periodic::Update-Package-Lists \"1\";\nAPT::Periodic::Unattended-Upgrade \"1\";\n" | |
48 | when: unattended_upgrades | bool | |
49 | - file: | |
50 | path: /etc/apt/apt.conf.d/20auto-upgrades | |
51 | state: "{{(unattended_upgrades|bool)|ternary('file', 'absent')}}" | |
52 | owner: root | |
53 | group: root | |
54 | mode: '0644' |