From 2258d3e8ea253d0a1366a269c52c0b38f967a359 Mon Sep 17 00:00:00 2001 From: pullyvan Date: Tue, 25 Jan 2022 09:24:35 +0100 Subject: [PATCH 1/2] add Centos 7, Ubuntu 18.04 and Ubuntu 20.04 selection checked in main.yml playbook --- tasks/{centos.yml => centos7.yml} | 1 - tasks/main.yml | 11 +++++--- tasks/{debian.yml => ubuntu18.yml} | 1 - tasks/ubuntu20.yml | 42 ++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 6 deletions(-) rename tasks/{centos.yml => centos7.yml} (97%) rename tasks/{debian.yml => ubuntu18.yml} (97%) create mode 100644 tasks/ubuntu20.yml diff --git a/tasks/centos.yml b/tasks/centos7.yml similarity index 97% rename from tasks/centos.yml rename to tasks/centos7.yml index 3ab7316..d842065 100644 --- a/tasks/centos.yml +++ b/tasks/centos7.yml @@ -20,7 +20,6 @@ - tmux - curl - tcsh - - firefox - unzip - make - gcc diff --git a/tasks/main.yml b/tasks/main.yml index 737b587..aed7321 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,10 @@ --- # tasks file for basics -- include: debian.yml tags=debian - when: ansible_os_family == 'Debian' +- include: ubuntu18.yml tags=debian + when: ansible_distribution_major_version == "18" -- include: centos.yml tags=centos - when: ansible_distribution == "CentOS" \ No newline at end of file +- include: ubuntu20.yml tags=debian + when: ansible_distribution_major_version == "20" + +- include: centos7.yml tags=centos + when: ansible_distribution_major_version == "7" diff --git a/tasks/debian.yml b/tasks/ubuntu18.yml similarity index 97% rename from tasks/debian.yml rename to tasks/ubuntu18.yml index 17ae1f3..fcc4644 100644 --- a/tasks/debian.yml +++ b/tasks/ubuntu18.yml @@ -21,7 +21,6 @@ - vim - nmon - tcsh - - firefox - eom - unzip - make diff --git a/tasks/ubuntu20.yml b/tasks/ubuntu20.yml new file mode 100644 index 0000000..fcc4644 --- /dev/null +++ b/tasks/ubuntu20.yml @@ -0,0 +1,42 @@ +--- +# tasks file for basics +- name: update & upgrade ubuntu + become: yes + package: + update_cache: yes + upgrade: yes + +- name: install basic tools via apt + become: yes + apt: + state: latest + pkg: + - git + - net-tools + - screen + - tmux + - gparted + - curl + - htop + - vim + - nmon + - tcsh + - eom + - unzip + - make + - gcc + - tcsh + - zsh + - csh + - ash + - bsh + - fish + - cifs-utils + - byobu + - software-properties-common + - gnupg + - gnupg1 + - gnupg2 +# - python3-boto +# - python3-boto3 +# - python3-botocore -- GitLab From 77de0dfee9148a6e24fed24978c08995a3be4d23 Mon Sep 17 00:00:00 2001 From: pullyvan Date: Tue, 25 Jan 2022 10:55:05 +0100 Subject: [PATCH 2/2] add specific version check for each OS supported by STI cluster --- tasks/{centos7.yml => centos.yml} | 0 tasks/main.yml | 14 +++++----- tasks/{ubuntu18.yml => ubuntu.yml} | 0 tasks/ubuntu20.yml | 42 ------------------------------ 4 files changed, 7 insertions(+), 49 deletions(-) rename tasks/{centos7.yml => centos.yml} (100%) rename tasks/{ubuntu18.yml => ubuntu.yml} (100%) delete mode 100644 tasks/ubuntu20.yml diff --git a/tasks/centos7.yml b/tasks/centos.yml similarity index 100% rename from tasks/centos7.yml rename to tasks/centos.yml diff --git a/tasks/main.yml b/tasks/main.yml index aed7321..5cf9bc5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,10 +1,10 @@ --- -# tasks file for basics -- include: ubuntu18.yml tags=debian - when: ansible_distribution_major_version == "18" -- include: ubuntu20.yml tags=debian - when: ansible_distribution_major_version == "20" +- include: ubuntu.yml tags=debian + when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "18" -- include: centos7.yml tags=centos - when: ansible_distribution_major_version == "7" +- include: ubuntu.yml tags=debian + when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "20" + +- include: centos.yml tags=centos + when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7" diff --git a/tasks/ubuntu18.yml b/tasks/ubuntu.yml similarity index 100% rename from tasks/ubuntu18.yml rename to tasks/ubuntu.yml diff --git a/tasks/ubuntu20.yml b/tasks/ubuntu20.yml deleted file mode 100644 index fcc4644..0000000 --- a/tasks/ubuntu20.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -# tasks file for basics -- name: update & upgrade ubuntu - become: yes - package: - update_cache: yes - upgrade: yes - -- name: install basic tools via apt - become: yes - apt: - state: latest - pkg: - - git - - net-tools - - screen - - tmux - - gparted - - curl - - htop - - vim - - nmon - - tcsh - - eom - - unzip - - make - - gcc - - tcsh - - zsh - - csh - - ash - - bsh - - fish - - cifs-utils - - byobu - - software-properties-common - - gnupg - - gnupg1 - - gnupg2 -# - python3-boto -# - python3-boto3 -# - python3-botocore -- GitLab