From e537f7b99249a577c6fa866d7af02155f8a4b4a2 Mon Sep 17 00:00:00 2001 From: Bas Date: Fri, 3 May 2019 13:26:47 +0200 Subject: [PATCH] devtoolset-3 (#5) * test for DTSVER=3 * using Cern Scientific Linux repo for devtoolset-3 (GCC 4.9.1) --- molecule/default/playbook.yml | 3 +- molecule/default/tests/test_default.yml | 2 - tasks/main.yml | 60 ++++++++++++++++++++----- vars/main.yml | 4 ++ 4 files changed, 55 insertions(+), 14 deletions(-) create mode 100644 vars/main.yml diff --git a/molecule/default/playbook.yml b/molecule/default/playbook.yml index 45e0221..90dcf28 100644 --- a/molecule/default/playbook.yml +++ b/molecule/default/playbook.yml @@ -2,7 +2,8 @@ - hosts: all vars: development_groupinstall: false + collections_enabled: true + DTSVER: 3 roles: - role: base_gcc - collections_enabled: true diff --git a/molecule/default/tests/test_default.yml b/molecule/default/tests/test_default.yml index 907b5b5..1fe7b56 100644 --- a/molecule/default/tests/test_default.yml +++ b/molecule/default/tests/test_default.yml @@ -5,7 +5,5 @@ package: installed: true autoconf: installed: true - gcc: - installed: true make: installed: true diff --git a/tasks/main.yml b/tasks/main.yml index 0c9a908..57f5848 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -17,6 +17,14 @@ tags: - base_gcc +- name: ensure yum-utils is installed + package: + name: yum-utils + state: present + when: collections_enabled and ansible_os_family == 'RedHat' + tags: + - base_gcc + - name: yum install development tools when: ansible_os_family == 'RedHat' and development_groupinstall yum: @@ -26,37 +34,57 @@ - base_gcc - name: install centos software collections + when: + - collections_enabled + - DTSVER|int > 3 or ansible_distribution_major_version|int == 7 + - ansible_distribution == 'CentOS' package: name: centos-release-scl state: present - when: collections_enabled and ansible_distribution == 'CentOS' tags: - base_gcc -- name: ensure yum-utils is installed - package: - name: yum-utils - state: present - when: collections_enabled and ansible_os_family == 'RedHat' +- name: install scientific linux software collections + when: + - collections_enabled + - DTSVER|int == 3 + - ansible_distribution == 'CentOS' + - ansible_distribution_major_version|int == 6 + get_url: + url: "{{ cern_repo_file }}" + dest: /etc/yum.repos.d + owner: root + group: root + tags: + - base_gcc - name: enable rhel software collections command: "yum-config-manager --enable rhel-server-rhscl-{{ ansible_distribution_major_version }}-rpms" - when: collections_enabled and ansible_distribution == 'Red Hat Enterprise Linux' + when: + - collections_enabled + - ansible_distribution == 'Red Hat Enterprise Linux' tags: - base_gcc -- name: enable legacy software collections - when: collections_enabled and DTSVER|int < 6 and ansible_os_family == 'RedHat' +- name: enable devtoolset-4 + when: + - collections_enabled + - DTSVER|int == 4 + - ansible_os_family == 'RedHat' command: "yum-config-manager --enable centos-sclo-rh-testing" changed_when: no tags: - base_gcc -- name: configure legacy software collection - when: collections_enabled and DTSVER|int == 3 +- name: configure legacy software collections + when: collections_enabled and DTSVER|int <= 3 set_fact: cplusplus_dts_rpms: - "{{ cplusplus_devtoolset }}-gcc-c++" + dts_disable_gpg_check: true + tags: + - base_gcc + - test - name: configure legacy software collection when: collections_enabled and DTSVER|int < 6 @@ -73,11 +101,13 @@ - ncurses-devel tags: - base_gcc + - test - name: yum install devtoolset rpms yum: name: "{{ cplusplus_dts_rpms }}" state: "{{ compilers_present }}" + disable_gpg_check: "{{ dts_disable_gpg_check }}" when: collections_enabled and ansible_os_family == 'RedHat' tags: - base_gcc @@ -121,6 +151,9 @@ when: collections_enabled and ansible_os_family == 'RedHat' set_fact: cmd_env: "source /opt/rh/{{ cplusplus_devtoolset }}/enable && " + tags: + - test + - base_gcc - name: apt install packages for C++ development when: ansible_os_family == 'Debian' @@ -138,7 +171,12 @@ changed_when: false tags: - skip_ansible_lint + - test + - base_gcc - name: Display details about gcc version debug: msg: "{{ gcc_version.stdout_lines[0] }}" + tags: + - test + - base_gcc diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..3bb1c5e --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,4 @@ +--- + +cern_repo_file: http://linuxsoft.cern.ch/cern/scl/slc6-scl.repo +dts_disable_gpg_check: false