From 88c3207573d8294d6e7b9e4ab020bafd4303cb36 Mon Sep 17 00:00:00 2001 From: Anthony Dieperink Date: Fri, 29 Jan 2021 12:57:42 +0100 Subject: [PATCH] Initial commit --- .travis.yml | 29 ---------------------------- README.md | 38 ++----------------------------------- defaults/main.yml | 28 ++++++++++++++++++++++++++- handlers/main.yml | 2 -- meta/main.yml | 24 +++++++----------------- tasks/main.yml | 48 +++++++++++------------------------------------ tests/inventory | 2 -- tests/test.yml | 5 ----- vars/main.yml | 2 -- 9 files changed, 47 insertions(+), 131 deletions(-) delete mode 100644 .travis.yml delete mode 100644 handlers/main.yml delete mode 100644 tests/inventory delete mode 100644 tests/test.yml delete mode 100644 vars/main.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 36bbf62..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: false - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/README.md b/README.md index 225dd44..0fdaee7 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,4 @@ -Role Name +Ansible Basics ========= -A brief description of the role goes here. - -Requirements ------------- - -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. - -Role Variables --------------- - -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. - -Dependencies ------------- - -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). +Install basics tools/packages for sticluster servers diff --git a/defaults/main.yml b/defaults/main.yml index 3206f03..d01dba8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,28 @@ --- -# defaults file for basics \ No newline at end of file +packages: + - git + - net-tools + - screen + - tmux + - gparted + - curl + - htop + - vim + - nmon + - tcsh + - firefox + - eom + - unzip + - make + - gcc + - tcsh + - zsh + - csh + - ash + - bsh + - fish + - cifs-utils + - software-properties-common + - gnupg + - gnupg1 + - gnupg2 diff --git a/handlers/main.yml b/handlers/main.yml deleted file mode 100644 index 693c10f..0000000 --- a/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for basics \ No newline at end of file diff --git a/meta/main.yml b/meta/main.yml index 9788807..8f87df5 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,7 +1,7 @@ --- galaxy_info: author: Dimitri Colier - description: Install basics tools for sticluster + description: Install basics tools/packages for sticluster servers company: EPFL issue_tracker_url: https://support.epfl.ch @@ -11,22 +11,12 @@ galaxy_info: platforms: - name: Ubuntu versions: + - focal - bionic + - name: Debian + versions: + - buster + - stretch galaxy_tags: - linux - - git - - net-tools - - screen - - tmux - - gparted - - curl - - htop - - vim - - nmon - - tcsh - - firefox - - eom - - unzip - - make - - gcc -dependencies: [] \ No newline at end of file + - packages diff --git a/tasks/main.yml b/tasks/main.yml index 59d4d33..463823d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,40 +1,14 @@ --- -# tasks file for basics -- name: update & upgrade ubuntu - become: yes - package: - update_cache: yes - upgrade: yes - -- name: install basic tools via apt - become: yes +- name: Update all system packages to their latest version with apt apt: + name: "*" + update_cache: yes state: latest - pkg: - - git - - net-tools - - screen - - tmux - - gparted - - curl - - htop - - vim - - nmon - - tcsh - - firefox - - eom - - unzip - - make - - gcc - - tcsh - - zsh - - csh - - ash - - bsh - - fish - - cifs-utils - - byobu - - software-properties-common - - gnupg - - gnupg1 - - gnupg2 + when: ansible_os_family == 'Debian' + +- name: Install basic packages with apt + apt: + name: "{{ packages }}" + update_cache: true + state: present + when: ansible_os_family == 'Debian' diff --git a/tests/inventory b/tests/inventory deleted file mode 100644 index 878877b..0000000 --- a/tests/inventory +++ /dev/null @@ -1,2 +0,0 @@ -localhost - diff --git a/tests/test.yml b/tests/test.yml deleted file mode 100644 index 980488c..0000000 --- a/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - basics \ No newline at end of file diff --git a/vars/main.yml b/vars/main.yml deleted file mode 100644 index 3e6f479..0000000 --- a/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for basics \ No newline at end of file -- GitLab