From 1a4efea2b7a6223a482e556a238310ad56ca3dd1 Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Sun, 16 Jul 2017 23:56:39 +0300 Subject: [PATCH] ansible: use gcc 4.9 on Ubuntu 14.04 --- ansible/roles/baselayout/tasks/main.yml | 17 ++++++++--------- .../tasks/partials/repo/ubuntu1404.yml | 12 ++++++++++++ ansible/roles/baselayout/vars/main.yml | 2 ++ 3 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 ansible/roles/baselayout/tasks/partials/repo/ubuntu1404.yml diff --git a/ansible/roles/baselayout/tasks/main.yml b/ansible/roles/baselayout/tasks/main.yml index 9e7ee5ce8..0d2c53349 100644 --- a/ansible/roles/baselayout/tasks/main.yml +++ b/ansible/roles/baselayout/tasks/main.yml @@ -61,15 +61,14 @@ - "{{ packages[os|stripversion]|default('[]') }}" - "{{ common_packages|default('[]') }}" -#- name: update package alteratives -# when: os == debian7 -# alterantives: -# loop_control: -# loop_var: gcc -# with_items: -# - gcc -# - g++ -# - cc +- name: update package alternatives + when: os == "ubuntu1404" + alternatives: link=/usr/bin/{{ gcc }} name={{ gcc }} path=/usr/bin/{{ gcc }}-4.9 + loop_control: + loop_var: gcc + with_items: + - gcc + - g++ - name: remove fortune from login shells when: os|stripversion == 'freebsd' diff --git a/ansible/roles/baselayout/tasks/partials/repo/ubuntu1404.yml b/ansible/roles/baselayout/tasks/partials/repo/ubuntu1404.yml new file mode 100644 index 000000000..0ee082355 --- /dev/null +++ b/ansible/roles/baselayout/tasks/partials/repo/ubuntu1404.yml @@ -0,0 +1,12 @@ +--- + +# +# add PPA for gcc 4.9 +# + +- name: "repo : add Ubuntu Toolchain PPA" + apt_repository: + repo: 'ppa:ubuntu-toolchain-r/test' + state: present + update_cache: yes + register: has_updated_package_repo \ No newline at end of file diff --git a/ansible/roles/baselayout/vars/main.yml b/ansible/roles/baselayout/vars/main.yml index 2801aca6d..5cb02c877 100644 --- a/ansible/roles/baselayout/vars/main.yml +++ b/ansible/roles/baselayout/vars/main.yml @@ -119,5 +119,7 @@ packages: { ubuntu1404: [ 'ntp', + 'g++-4.9', + 'gcc-4.9', ] }