Skip to content

Instantly share code, notes, and snippets.

@pfsmorigo
Created March 20, 2018 13:33
Show Gist options
  • Save pfsmorigo/cb0d96e391ef87e1083a5dcccf6ea853 to your computer and use it in GitHub Desktop.
Save pfsmorigo/cb0d96e391ef87e1083a5dcccf6ea853 to your computer and use it in GitHub Desktop.
---
- name: Check if GPG is installed
when: ansible_os_family == "Debian"
register: result
changed_when: result.rc == 1
failed_when: result.rc >= 2
shell: apt-key fingerprint | grep -q "AdvanceToolchain"
- name: Add official GPG key
become: yes
when: ansible_os_family == "Debian" and result.rc == 1
shell: curl -fsSL ftp://ftp.unicamp.br/pub/linuxpatch/toolchain/at/ubuntu/dists/trusty/6976a827.gpg.key | apt-key add -
- name: Check if repository is set
when: ansible_os_family == "Debian"
register: result
changed_when: result.rc == 1
failed_when: result.rc >= 2
shell: grep -q "toolchain/at" /etc/apt/sources.list
- name: Add repository
become: yes
when: ansible_os_family == "Debian" and result.rc == 1
shell: add-apt-repository "deb ftp://ftp.unicamp.br/pub/linuxpatch/toolchain/at/ubuntu xenial at11.0"
- name: Install packages
become: yes
when: ansible_os_family == "Debian"
apt: name={{ item }} state=present update_cache=yes
with_items:
- advance-toolchain-at11.0-runtime
- advance-toolchain-at11.0-devel
- advance-toolchain-at11.0-perf
- advance-toolchain-at11.0-mcore-libs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment