Skip to content

Commit b4cf8f1

Browse files
committed
The "ansible/" directory in which the application installation automation script is located has been added to the branch
1 parent ea80098 commit b4cf8f1

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

ansible/install-apps.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
3+
- name: Install OS-level apps
4+
hosts: all
5+
become: yes
6+
vars:
7+
- apt_file: /etc/apt/sources.list.d/google-chrome.list
8+
- apt_file_Git:
9+
tasks:
10+
- name: Does the Google apt file exist?
11+
command: test -f {{apt_file}}
12+
register: google_apt_exists
13+
ignore_errors: yes
14+
15+
- name: Add Google Chrome key
16+
shell: echo 'deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main'>/etc/apt/sources.list.d/google-chrome.list
17+
when: google_apt_exists.rc == 1
18+
19+
- name: Add Google Chrome repo
20+
copy: content="deb http://dl.google.com/linux/chrome/deb/ stable main" dest={{apt_file}} owner=root group=root mode=644
21+
when: google_apt_exists.rc == 1
22+
23+
24+
- name: Update apt cache
25+
apt: update_cache=yes
26+
when: google_apt_exists.rc == 1
27+
28+
- name: Install apps
29+
apt:
30+
name: "{{ packages }}"
31+
vars:
32+
packages:
33+
- google-chrome-stable
34+
- git

ansible/inventory

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[localhost]
2+
3+
127.0.0.1 ansible_connection=local

0 commit comments

Comments
 (0)