Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/dotfiles
Path: blob/master/linux/main.yml
245 views
1
---
2
- hosts: localhost
3
connection: local
4
become: yes
5
6
vars_files:
7
- vars.yml
8
9
pre_tasks:
10
- name: Update apt cache if necessary
11
apt: update_cache=true cache_valid_time=86400
12
ignore_errors: yes
13
14
- name: Add custom keys
15
apt_key:
16
url: "{{ item }}"
17
state: present
18
with_items:
19
- "{{ apt_keys }}"
20
when: ansible_distribution == "Ubuntu"
21
22
- name: Add custom repos
23
apt_repository:
24
repo: "{{ item }}"
25
state: present
26
with_items:
27
- "{{ apt_repos }}"
28
when: ansible_distribution == "Ubuntu"
29
30
roles:
31
#- geerlingguy.pip
32
- geerlingguy.docker
33
34
tasks:
35
- name: Install Ubuntu packages
36
apt:
37
name: "{{ apt_packages|map(attribute='pkg')|list }}"
38
state: present
39
when: ansible_distribution == "Ubuntu"
40
41
- name: Install go packages
42
command:
43
cmd: "/usr/bin/go get {{ item }}"
44
creates: "{{ lookup('env', 'GOBIN') }}/{{ item }}"
45
with_items:
46
- "{{ go_packages }}"
47
become: no
48
49