Install Sublime Text on Debian and Archlinux (x86_64)

This commit is contained in:
Jan Beilicke 2020-12-15 23:44:32 +01:00
parent 1273c2298b
commit 17b61d3665
3 changed files with 74 additions and 24 deletions

View file

@ -1,27 +1,26 @@
---
# tasks file for jotbe.dev-tools
- name: Provide dev-tools
block:
- name: Add key for Sublime Text repo
apt_key:
url: https://download.sublimetext.com/sublimehq-pub.gpg
state: present
- name: Add repository for Sublime Text
apt_repository:
repo: deb https://download.sublimetext.com/ apt/stable/
state: present
- name: Update apt cache
apt:
update_cache: yes
cache_valid_time: 7200
- name: Install Sublime Text
apt:
pkg:
- sublime-text
register: sublime_text_installed
- name: Provide dev-tools (on Debian)
include_tasks:
file: sublime_text_debian.yml
apply:
tags:
- sublime_text
when: ansible_facts['os_family'] == 'Debian'
become: yes
- name: Provide dev-tools (on Debian)
include_tasks:
file: sublime_text_debian.yml
apply:
tags:
- sublime_text
when: ansible_facts['os_family'] == 'Debian'
- name: Provide dev-tools (on Archlinux)
include_tasks:
file: sublime_text_archlinux.yml
apply:
tags:
- sublime_text
when:
- ansible_facts['os_family'] == 'Archlinux'

View file

@ -0,0 +1,27 @@
---
- name: Install Sublime Text (on Archlinux)
block:
- name: Add key for Sublime Text repo
shell:
cmd: |
curl -O https://download.sublimetext.com/sublimehq-pub.gpg && \
sudo pacman-key --add sublimehq-pub.gpg && sudo pacman-key --lsign-key 8A8F901A && \
rm sublimehq-pub.gpg
- name: Add repository for Sublime Text
blockinfile:
path: /etc/pacman.conf
block: |
[sublime-text]
Server = https://download.sublimetext.com/arch/dev/x86_64
- name: Install Sublime Text
pacman:
name: sublime-text
state: latest
update_cache: yes
register: sublime_text_installed
when:
- ansible_architecture == 'x86_64'
become: yes

View file

@ -0,0 +1,24 @@
---
- name: Install Sublime Text (on Debian)
block:
- name: Add key for Sublime Text repo
apt_key:
url: https://download.sublimetext.com/sublimehq-pub.gpg
state: present
- name: Add repository for Sublime Text
apt_repository:
repo: deb https://download.sublimetext.com/ apt/stable/
state: present
- name: Update apt cache
apt:
update_cache: yes
cache_valid_time: 7200
- name: Install Sublime Text
apt:
pkg:
- sublime-text
register: sublime_text_installed
become: true