commit a87dee2dd7395ac583864392eba448fae2bda3ea
parent c696a26fd428d3d9a82c6307d5313d03d2a442d1
Author: Vincent Demeester <vincent@sbr.pm>
Date: Fri, 17 May 2019 00:16:24 +0200
Update ansible roles
- add gcloud
- add vscode
- add syncthing
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
7 files changed, 65 insertions(+), 2 deletions(-)
diff --git a/playbook.yml b/playbook.yml
@@ -4,6 +4,8 @@
- common
- desktop
- { role: laptop, when: ansible_form_factor == 'Notebook' }
+ - gcloud
+ - dev
# ansible_hostname == 'hokkaido'
# ansible_product_version == 'ThinkPad X220'
diff --git a/roles/desktop/tasks/main.yml b/roles/desktop/tasks/main.yml
@@ -1,4 +1,5 @@
---
- include: gnome.yml
when: ansible_distribution == 'Fedora'
-- include: media.yml-
\ No newline at end of file
+- include: media.yml
+- include: syncthing.yml+
\ No newline at end of file
diff --git a/roles/desktop/tasks/syncthing.yml b/roles/desktop/tasks/syncthing.yml
@@ -0,0 +1,11 @@
+---
+- name: Install syncthing
+ become: yes
+ package: name={{item}} state=present
+ with_items:
+ - syncthing
+- name: Enable and ensure Syncthing is started
+ systemd:
+ name: syncthing@vincent
+ enabled: yes
+ state: started+
\ No newline at end of file
diff --git a/roles/dev/files/vscode.repo b/roles/dev/files/vscode.repo
@@ -0,0 +1,6 @@
+[code]
+name=Visual Studio Code
+baseurl=https://packages.microsoft.com/yumrepos/vscode
+enabled=1
+gpgcheck=1
+gpgkey=https://packages.microsoft.com/keys/microsoft.asc
diff --git a/roles/dev/tasks/main.yml b/roles/dev/tasks/main.yml
@@ -0,0 +1,21 @@
+---
+- name: add vscode rpm key
+ rpm_key:
+ state: present
+ key: https://packages.microsoft.com/keys/microsoft.asc
+ when: ansible_distribution == 'Fedora'
+- name: add rpmfusion repos
+ copy:
+ src: "{{ item }}"
+ dest: "/etc/yum.repos.d/{{ item }}"
+ owner: root
+ group: root
+ mode: 0644
+ with_items:
+ - vscode.repo
+ when: ansible_distribution == 'Fedora'
+- name: install vscode
+ become: yes
+ package: name={{item}} state=present
+ with_items:
+ - code+
\ No newline at end of file
diff --git a/roles/gcloud/files/google-cloud-sdk.repo b/roles/gcloud/files/google-cloud-sdk.repo
@@ -0,0 +1,8 @@
+[google-cloud-sdk]
+name=Google Cloud SDK
+baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64
+enabled=1
+gpgcheck=1
+repo_gpgcheck=1
+gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
+ https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
diff --git a/roles/gcloud/tasks/main.yml b/roles/gcloud/tasks/main.yml
@@ -0,0 +1,11 @@
+---
+- name: add google-cloud-sdk repo
+ copy:
+ src: "google-cloud-sdk.repo"
+ dest: "/etc/yum.repos.d/google-cloud-sdk.repo"
+ owner: root
+ group: root
+ mode: 0644
+- name: install google-cloud-sdk
+ become: yes
+ package: name=google-cloud-sdk state=present+
\ No newline at end of file