diff --git a/.github/license.svg b/.github/license.svg new file mode 100644 index 0000000..4ab6d9a --- /dev/null +++ b/.github/license.svg @@ -0,0 +1,217 @@ + + + + + + image/svg+xml + + + + + + 3D <l3d@c3woc.de> + + + + + MIT License + + + + + + + + + + + + + + + + + + + + + + + + + + + MIT + MIT + + + license + license + + diff --git a/.github/workflows/ansible-debian-jessie.yml b/.github/workflows/ansible-debian-jessie.yml deleted file mode 100644 index abe651e..0000000 --- a/.github/workflows/ansible-debian-jessie.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Ansible check debian:jessie - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: ansible check with debian:jessie - uses: roles-ansible/check-ansible-debian-jessie-action@master - with: - targets: "./" diff --git a/.travis.yml b/.travis.yml index 274de81..4dc7895 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,28 +1,28 @@ ---- -# OS Details -os: linux language: python -python: '3.8' +python: "3.8" -cache: - pip: true +# Use the new container infrastructure +sudo: false + +# Install ansible +addons: + apt: + packages: + - python-pip -# Install ansible and ansible-lint install: + # Install ansible - pip install ansible - - pip install ansible-lint -# testing galaxy install and ansible lint -# more advanced testing is currently handled with -# github actions. The gh-actions for our test are there: -# https://github.com/roles-ansible and are tagged -# with 'github-actions' --> https://github.com/search?q=topic%3Agithub-actions+org%3Aroles-ansible&type=Repositories + # Check ansible version + - ansible --version + + # Create ansible.cfg with correct roles_path + - printf '[defaults]\nroles_path=../' >ansible.cfg + script: - - ansible-lint . - - echo -e "\n\n\n\n\nWe use github actions for more detailed tests.\n\nMore details about that in our github repo at:\nhttps://github.com/roles-ansible/role-ranger/actions\n\n\n\n\n\n" + # Basic role syntax check + - ansible-playbook tests/test.yml -i tests/inventory --syntax-check notifications: - email: - on_success: never - on_failure: always webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/README.md b/README.md index 824e17c..ee14bab 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,75 @@ - Ansible Role to install packages +[![MIT License](https://raw.githubusercontent.com/roles-ansible/ansible_role_base/master/.github/license.svg?sanitize=true)](https://github.com/roles-ansible/ansible_role_base/blob/master/LICENSE) + +Ansible Role to install packages --------------------- -This is an ansible role to install some basic packages, you could need. -It should work on the most linux operating systems. Maybe it need some minor adjustments. +A base ansible role that should run on common Linux systems. -If this is so, please create a pull request or at least creat an issue with what is broken! +This role adds more package sources to Debian. And installs some useful tools. This role adds more package sources to Debian. And installs some useful tools. The complete list of tools to install can be found in the [vars/main.yml](https://github.com/roles-ansible/ansible_role_base/blob/master/vars/main.yml). -### Testing: -This role was initial written for ``Debian 9`` and ``Fedora 29``. -In Spring 2019 it was only used on ``Debian 9``, ``Ubuntu 18.04 LTS`` and ``Ubuntu 19.4``. No ``RHEL`` based Systems anymore. -In Spring 2019 it was used on ``Debian 9``, ``Ubuntu 18.04 LTS``, ``Ubuntu 19.4`` and ``centos 7``. -In 2020 it expanded to more linux Systems such as ``Debian buster`` and ``Ubuntu 20.4 LTS``. +Optionally you can also set vim as the default editor and update all packages to ``latest''. - variables ------------ -There are some variables defined to configure the packages which should be installed. +### variables: -Please have a look into ``defaults/main.yml`` for more details. +For a complete overview of all variables have a deeper look into the ``vars`` nd the ``defaults`` Folder!. -You can configure your own packages via host- or group-vars to change what packages should be installed. +```yml +--- +# install these additional packages +base__extra_packages: [] +# - foo +# - bar -have fun! And don't be evil! +# should we add additional package source? +base__add_ethz: true -### Protip: -Packages are defined as variable in the ``vars`` Folder. +# add nonfree/firmware packages? +base__pkg_non_free_firmware: false +base__pkg_contrib: false - Open tasks ------------- -- Some CI-Testing would be nice. Eg with docker and some common linux distributions. +# optionaly print some OS vars +base__print_os_vars: false + +# choose latest or present for package state +# set this to latest for updating all packages! +base__package_state: 'present' + +# should we update all packages? +base__upgrade_packages_to_latest_version: false + +# perform a simple versions check (true is recomended) +submodules_versioncheck: false +``` + +### testing +This role is tested with [these github-action](https://github.com/search?q=topic%3Acheck-ansible+topic%3Agithub-actions+org%3Aroles-ansible&type=Repositories) tests for different versions of differen linux systems. Linting is tested via travis-ci and the [ansible-lint action](https://github.com/marketplace/actions/ansible-lint). +If you want to find out more about our tests, please have a look at the github marketplace. + +| test status | Github Marketplace | +| :--------- | :---------------- | +| [![Travis Build Status](https://travis-ci.org/roles-ansible/ansible_role_base.svg?branch=master)](https://travis-ci.org/roles-ansible/ansible_role_base) | [.travis.yml](https://github.com/roles-ansible/ansible_role_base/blob/master/.travis.yml) | +||| +| [![Ansible Lint check](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20Lint%20check/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+Lint+check%22) | [ansible-lint action](https://github.com/marketplace/actions/ansible-lint) +| [![Ansible check debian:stable](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20debian:stable/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+debian%3Astable%22) | [ansible test with debian stable](https://github.com/marketplace/actions/check-ansible-debian-stable) | +| [![Ansible check debian:latest](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20debian:latest/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+debian%3Alatest%22) | [ansible test with debian latest](https://github.com/marketplace/actions/check-ansible-debian-latest) | +| [![Ansible check debian:sid](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20debian:sid/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+debian%3Asid%22) | [ansible test with debian sid](https://github.com/marketplace/actions/check-ansible-debian-sid) | +| [![Ansible check debian:buster](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20debian:buster/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+debian%3Abuster%22) | [ansible test with debian buster](https://github.com/marketplace/actions/check-ansible-debian-buster) | +| [![Ansible check debian:stretch](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20debian:stretch/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+debian%3Astretch%22) | [ansible test with debian stretch](https://github.com/marketplace/actions/check-ansible-debian-stretch) | +| | | +| [![Ansible check archlinux:latest](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20archlinux:latest/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+archlinux%3Alatest%22) | [ansible test with archlinux latest](https://github.com/marketplace/actions/check-ansible-archlinux-latest) | +| | | +| [![Ansible check ubuntu:latest](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20ubuntu:latest/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+ubuntu%3Alatest%22) | [ansible test with ubuntu latest](https://github.com/marketplace/actions/check-ansible-ubuntu-latest) | +| [![Ansible check ubuntu:bionic](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20ubuntu:bionic/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+ubuntu%3Abionic%22) | [ansible test with ubuntu bionic](https://github.com/marketplace/actions/check-ansible-ubuntu-bionic) | +| [![Ansible check ubuntu:eoan](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20ubuntu:eoan/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+ubuntu%3Aeoan%22) | [ansible test with ubuntu eoan](https://github.com/marketplace/actions/check-ansible-ubuntu-eoan) | +| [![Ansible check ubuntu:trusty](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20ubuntu:trusty/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+ubuntu%3Atrusty%22) | [ansible test with ubuntu trusty](https://github.com/marketplace/actions/check-ansible-ubuntu-trusty) | +| [![Ansible check ubuntu:xenial](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20ubuntu:xenial/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+ubuntu%3Axenial%22) | [ansible test with ubuntu xenial](https://github.com/marketplace/actions/check-ansible-ubuntu-xenial) | +| | | +| [![Ansible check fedora:latest](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20fedora:latest/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+fedora%3Alatest%22) | [ansible test with fedora latest](https://github.com/marketplace/actions/check-ansible-fedora-latest) | +| [![Ansible check fedora:33](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20fedora:33/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+fedora%3A33%22) | [ansible test with fedora 33](https://github.com/marketplace/actions/check-ansible-fedora-33) | +| [![Ansible check fedora:32](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20fedora:32/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+fedora%3A32%22) | [ansible test with fedora 32](https://github.com/marketplace/actions/check-ansible-fedora-32) | +| [![Ansible check fedora:31](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20fedora:31/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+fedora%3A31%22) | [ansible test with fedora 31](https://github.com/marketplace/actions/check-ansible-fedora-31) | +| | | +| [![Ansible check centos:latest](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20centos:latest/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+centos%3Alatest%22) | [ansible test with centos latest](https://github.com/marketplace/actions/check-ansible-centos-latest) | +| [![Ansible check centos:centos8](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20centos:centos8/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+centos%3Acentos8%22) | [ansible test with centos centos8](https://github.com/marketplace/actions/check-ansible-centos-centos8) | +| [![Ansible check centos:centos7](https://github.com/roles-ansible/ansible_role_base/workflows/Ansible%20check%20centos:centos7/badge.svg)](https://github.com/roles-ansible/ansible_role_base/actions?query=workflow%3A%22Ansible+check+centos%3Acentos7%22) | [ansible test with centos centos7](https://github.com/marketplace/actions/check-ansible-centos-centos7) | diff --git a/defaults/main.yml b/defaults/main.yml index cd2d940..37e73b3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -43,4 +43,4 @@ base_pkg_non_free_firmware: false base_pkg_contrib: false # version management -submodules_versioncheck: true +submodules_versioncheck: false diff --git a/tasks/versioncheck.yml b/tasks/versioncheck.yml index 7977e52..fa361f6 100644 --- a/tasks/versioncheck.yml +++ b/tasks/versioncheck.yml @@ -42,5 +42,5 @@ copy: content: "{{ playbook_version_number }}" dest: "/etc/.ansible-version/{{ playbook_version_path }}" - mode: 0644 + mode: '0644' when: submodules_versioncheck|bool