From a757e16981cf9c9c79b607febed2e6bdf01de7d8 Mon Sep 17 00:00:00 2001 From: L3D Date: Fri, 28 Aug 2020 14:01:22 +0200 Subject: [PATCH] Update role and add some actions --- .github/workflows/ansible-alpine-latest.yml | 16 +++++ .../workflows/ansible-archlinux-latest.yml | 16 +++++ .github/workflows/ansible-centos-centos6.yml | 16 +++++ .github/workflows/ansible-centos-centos7.yml | 16 +++++ .github/workflows/ansible-centos-centos8.yml | 16 +++++ .github/workflows/ansible-centos-latest.yml | 16 +++++ .github/workflows/ansible-debian-buster.yml | 16 +++++ .github/workflows/ansible-debian-jessie.yml | 16 +++++ .github/workflows/ansible-debian-latest.yml | 16 +++++ .github/workflows/ansible-debian-sid.yml | 16 +++++ .github/workflows/ansible-debian-stable.yml | 16 +++++ .github/workflows/ansible-debian-stretch.yml | 16 +++++ .github/workflows/ansible-fedora-31.yml | 16 +++++ .github/workflows/ansible-fedora-32.yml | 16 +++++ .github/workflows/ansible-fedora-33.yml | 16 +++++ .github/workflows/ansible-fedora-latest.yml | 16 +++++ .github/workflows/ansible-linting-check.yml | 20 ++++++ .github/workflows/ansible-ubuntu-bionic.yml | 16 +++++ .github/workflows/ansible-ubuntu-eoan.yml | 16 +++++ .github/workflows/ansible-ubuntu-latest.yml | 16 +++++ .github/workflows/ansible-ubuntu-trusty.yml | 16 +++++ .github/workflows/ansible-ubuntu-xenial.yml | 16 +++++ .travis.yml | 28 ++++++++ README.md | 3 +- defaults/main.yml | 7 +- tasks/main.yml | 68 ++----------------- tasks/packages.yml | 1 - vars/main.yml | 9 +-- 28 files changed, 398 insertions(+), 74 deletions(-) create mode 100644 .github/workflows/ansible-alpine-latest.yml create mode 100644 .github/workflows/ansible-archlinux-latest.yml create mode 100644 .github/workflows/ansible-centos-centos6.yml create mode 100644 .github/workflows/ansible-centos-centos7.yml create mode 100644 .github/workflows/ansible-centos-centos8.yml create mode 100644 .github/workflows/ansible-centos-latest.yml create mode 100644 .github/workflows/ansible-debian-buster.yml create mode 100644 .github/workflows/ansible-debian-jessie.yml create mode 100644 .github/workflows/ansible-debian-latest.yml create mode 100644 .github/workflows/ansible-debian-sid.yml create mode 100644 .github/workflows/ansible-debian-stable.yml create mode 100644 .github/workflows/ansible-debian-stretch.yml create mode 100644 .github/workflows/ansible-fedora-31.yml create mode 100644 .github/workflows/ansible-fedora-32.yml create mode 100644 .github/workflows/ansible-fedora-33.yml create mode 100644 .github/workflows/ansible-fedora-latest.yml create mode 100644 .github/workflows/ansible-linting-check.yml create mode 100644 .github/workflows/ansible-ubuntu-bionic.yml create mode 100644 .github/workflows/ansible-ubuntu-eoan.yml create mode 100644 .github/workflows/ansible-ubuntu-latest.yml create mode 100644 .github/workflows/ansible-ubuntu-trusty.yml create mode 100644 .github/workflows/ansible-ubuntu-xenial.yml create mode 100644 .travis.yml diff --git a/.github/workflows/ansible-alpine-latest.yml b/.github/workflows/ansible-alpine-latest.yml new file mode 100644 index 0000000..8b9d618 --- /dev/null +++ b/.github/workflows/ansible-alpine-latest.yml @@ -0,0 +1,16 @@ +name: Ansible check alpine:latest + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with alpine:latest + uses: roles-ansible/check-ansible-alpine-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-archlinux-latest.yml b/.github/workflows/ansible-archlinux-latest.yml new file mode 100644 index 0000000..9d651a3 --- /dev/null +++ b/.github/workflows/ansible-archlinux-latest.yml @@ -0,0 +1,16 @@ +name: Ansible check archlinux:latest + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with archlinux:latest + uses: roles-ansible/check-ansible-archlinux-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-centos-centos6.yml b/.github/workflows/ansible-centos-centos6.yml new file mode 100644 index 0000000..6907237 --- /dev/null +++ b/.github/workflows/ansible-centos-centos6.yml @@ -0,0 +1,16 @@ +name: Ansible check centos:centos6 + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:centos6 + uses: roles-ansible/check-ansible-centos-centos6-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-centos-centos7.yml b/.github/workflows/ansible-centos-centos7.yml new file mode 100644 index 0000000..90bff41 --- /dev/null +++ b/.github/workflows/ansible-centos-centos7.yml @@ -0,0 +1,16 @@ +name: Ansible check centos:centos7 + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:centos7 + uses: roles-ansible/check-ansible-centos-centos7-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-centos-centos8.yml b/.github/workflows/ansible-centos-centos8.yml new file mode 100644 index 0000000..5d7acc9 --- /dev/null +++ b/.github/workflows/ansible-centos-centos8.yml @@ -0,0 +1,16 @@ +name: Ansible check centos:centos8 + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:centos8 + uses: roles-ansible/check-ansible-centos-centos8-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-centos-latest.yml b/.github/workflows/ansible-centos-latest.yml new file mode 100644 index 0000000..de991de --- /dev/null +++ b/.github/workflows/ansible-centos-latest.yml @@ -0,0 +1,16 @@ +name: Ansible check centos:latest + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:latest + uses: roles-ansible/check-ansible-centos-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-buster.yml b/.github/workflows/ansible-debian-buster.yml new file mode 100644 index 0000000..a7650ad --- /dev/null +++ b/.github/workflows/ansible-debian-buster.yml @@ -0,0 +1,16 @@ +name: Ansible check debian:buster + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with debian:buster + uses: roles-ansible/check-ansible-debian-buster-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-jessie.yml b/.github/workflows/ansible-debian-jessie.yml new file mode 100644 index 0000000..abe651e --- /dev/null +++ b/.github/workflows/ansible-debian-jessie.yml @@ -0,0 +1,16 @@ +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/.github/workflows/ansible-debian-latest.yml b/.github/workflows/ansible-debian-latest.yml new file mode 100644 index 0000000..d0ad4ca --- /dev/null +++ b/.github/workflows/ansible-debian-latest.yml @@ -0,0 +1,16 @@ +name: Ansible check debian:latest + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with debian:latest + uses: roles-ansible/check-ansible-debian-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-sid.yml b/.github/workflows/ansible-debian-sid.yml new file mode 100644 index 0000000..72fe3a8 --- /dev/null +++ b/.github/workflows/ansible-debian-sid.yml @@ -0,0 +1,16 @@ +name: Ansible check debian:sid + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with debian:sid + uses: roles-ansible/check-ansible-debian-sid-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-stable.yml b/.github/workflows/ansible-debian-stable.yml new file mode 100644 index 0000000..97076ae --- /dev/null +++ b/.github/workflows/ansible-debian-stable.yml @@ -0,0 +1,16 @@ +name: Ansible check debian:stable + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with debian:stable + uses: roles-ansible/check-ansible-debian-stable-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-debian-stretch.yml b/.github/workflows/ansible-debian-stretch.yml new file mode 100644 index 0000000..19ac5fb --- /dev/null +++ b/.github/workflows/ansible-debian-stretch.yml @@ -0,0 +1,16 @@ +name: Ansible check debian:stretch + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with debian:stretch + uses: roles-ansible/check-ansible-debian-stretch-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-fedora-31.yml b/.github/workflows/ansible-fedora-31.yml new file mode 100644 index 0000000..6bbe44d --- /dev/null +++ b/.github/workflows/ansible-fedora-31.yml @@ -0,0 +1,16 @@ +name: Ansible check fedora:31 + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with fedora:31 + uses: roles-ansible/check-ansible-fedora-31-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-fedora-32.yml b/.github/workflows/ansible-fedora-32.yml new file mode 100644 index 0000000..70fc147 --- /dev/null +++ b/.github/workflows/ansible-fedora-32.yml @@ -0,0 +1,16 @@ +name: Ansible check fedora:32 + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with fedora:32 + uses: roles-ansible/check-ansible-fedora-32-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-fedora-33.yml b/.github/workflows/ansible-fedora-33.yml new file mode 100644 index 0000000..6032811 --- /dev/null +++ b/.github/workflows/ansible-fedora-33.yml @@ -0,0 +1,16 @@ +name: Ansible check fedora:33 + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with fedora:33 + uses: roles-ansible/check-ansible-fedora-33-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-fedora-latest.yml b/.github/workflows/ansible-fedora-latest.yml new file mode 100644 index 0000000..8b14097 --- /dev/null +++ b/.github/workflows/ansible-fedora-latest.yml @@ -0,0 +1,16 @@ +name: Ansible check fedora:latest + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with fedora:latest + uses: roles-ansible/check-ansible-fedora-latest-action@master + with: + targets: "./" \ No newline at end of file diff --git a/.github/workflows/ansible-linting-check.yml b/.github/workflows/ansible-linting-check.yml new file mode 100644 index 0000000..712c76f --- /dev/null +++ b/.github/workflows/ansible-linting-check.yml @@ -0,0 +1,20 @@ +name: Ansible Lint check + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Lint Ansible Playbook + uses: ansible/ansible-lint-action@master + with: + targets: "." + # [required] + # Paths to ansible files (i.e., playbooks, tasks, handlers etc..) + args: "" + # [optional] diff --git a/.github/workflows/ansible-ubuntu-bionic.yml b/.github/workflows/ansible-ubuntu-bionic.yml new file mode 100644 index 0000000..aea24a2 --- /dev/null +++ b/.github/workflows/ansible-ubuntu-bionic.yml @@ -0,0 +1,16 @@ +name: Ansible check ubuntu:bionic + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:bionic + uses: roles-ansible/check-ansible-ubuntu-bionic-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-ubuntu-eoan.yml b/.github/workflows/ansible-ubuntu-eoan.yml new file mode 100644 index 0000000..30b5779 --- /dev/null +++ b/.github/workflows/ansible-ubuntu-eoan.yml @@ -0,0 +1,16 @@ +name: Ansible check ubuntu:eoan + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:eoan + uses: roles-ansible/check-ansible-ubuntu-eoan-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-ubuntu-latest.yml b/.github/workflows/ansible-ubuntu-latest.yml new file mode 100644 index 0000000..2e34685 --- /dev/null +++ b/.github/workflows/ansible-ubuntu-latest.yml @@ -0,0 +1,16 @@ +name: Ansible check ubuntu:latest + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:latest + uses: roles-ansible/check-ansible-ubuntu-latest-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-ubuntu-trusty.yml b/.github/workflows/ansible-ubuntu-trusty.yml new file mode 100644 index 0000000..a18c397 --- /dev/null +++ b/.github/workflows/ansible-ubuntu-trusty.yml @@ -0,0 +1,16 @@ +name: Ansible check ubuntu:trusty + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:trusty + uses: roles-ansible/check-ansible-ubuntu-trusty-action@master + with: + targets: "./" diff --git a/.github/workflows/ansible-ubuntu-xenial.yml b/.github/workflows/ansible-ubuntu-xenial.yml new file mode 100644 index 0000000..3bf993d --- /dev/null +++ b/.github/workflows/ansible-ubuntu-xenial.yml @@ -0,0 +1,16 @@ +name: Ansible check ubuntu:xenial + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: ansible check with ubuntu:xenial + uses: roles-ansible/check-ansible-ubuntu-xenial-action@master + with: + targets: "./" diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..274de81 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,28 @@ +--- +# OS Details +os: linux +language: python +python: '3.8' + +cache: + pip: true + +# Install ansible and ansible-lint +install: + - 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 +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" + +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 9d80cc4..824e17c 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ If this is so, please create a pull request or at least creat an issue with what 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``. variables ----------- @@ -28,5 +29,3 @@ Packages are defined as variable in the ``vars`` Folder. Open tasks ------------ - Some CI-Testing would be nice. Eg with docker and some common linux distributions. -- Meta File for Ansible Galaxy is missing -- Lint checks? diff --git a/defaults/main.yml b/defaults/main.yml index 653932a..cd2d940 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,9 +13,12 @@ base__pkg_contrib: "{{ base_pkg_contrib }}" # optionaly print some OS vars base__print_os_vars: "{{ print_os_vars }}" +# 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: "{{ upgrade_packages_to_latest_version }}" # LEGACY VARS # ++ WILL BE REMOVED SOON ++ @@ -24,7 +27,7 @@ add_ethz: true # do we want the latest package version or just upgrade manually? -upgrade_packages_to_latest_version: true +upgrade_packages_to_latest_version: false # we use vim! diff --git a/tasks/main.yml b/tasks/main.yml index 5d7175e..cce1ace 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,67 +13,13 @@ - include_tasks: packages.yml - - - -#- name: Install common base packages [Debian] -# become: yes -# apt: -# package: "{{ debian_packages }}" -# state: present -# update_cache: yes -# cache_valid_time: 43200 -# when: ansible_os_family == 'Debian' and ansible_distribution_version != '7' and ansible_distribution_release != 'wheezy' and ansible_machine != 'armv6l' - - -#-# name: Install common base packages [Fedora] -# become: yes -# package: -# name: "{{ fedora_packages }}" -# state: present -# when: ansible_distribution == 'Fedora' -# -#- name: install packages for everyone except centos/rhel -# become: true -# package: -# name: "{{ packages_for_all_except_rhel }}" -# state: present -# when: -# - ansible_os_family != 'RedHat' -# - ansible_distribution_version != "14.04" -# - ansible_distribution_version != "12.04" -# - ansible_distribution_release != 'wheezy' -# - ansible_machine != 'armv6l' and ansible_distribution_release != 'wheezy' - -#- name: Install extra packages -# become: true -# package: -# name: "{{ packages_extra }}" -# state: present -# when: -# - packages_extra is defined -# - packages_extra != '[]' -# - ansible_machine != 'armv6l' and ansible_distribution_release != 'wheezy' -# -#- name: Remove rpcbind, nfs-common -# become: yes -# package: -# name: -# - rpcbind -# - nfs-common -# state: absent -# when: -# - ansible_machine != 'armv6l' and ansible_distribution_release != 'wheezy' -# - ansible_os_family == 'Debian' -# -#- name: Upgrade all packages to latest -# become: true -# package: -# name: "*" -# state: latest -# when: -# - upgrade_packages_to_latest_version|bool -# - ansible_machine != 'armv6l' and ansible_distribution_release != 'wheezy' +- name: Upgrade all packages to latest + become: true + package: + name: "*" + state: "{{ base__package_state }}" + when: + - base__upgrade_packages_to_latest_version|bool - include_tasks: editor.yml when: editor_is_vim | bool diff --git a/tasks/packages.yml b/tasks/packages.yml index 70cc5dd..60d6e56 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -35,4 +35,3 @@ ansible_distribution == 'Fedora' and ansible_distribution_version | float >= 32 or ansible_distribution == 'Debian' and ansible_distribution_version | float >= 8 or ansible_os_family == 'Archlinux' - diff --git a/vars/main.yml b/vars/main.yml index 6aced40..33217cc 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -54,12 +54,5 @@ base__linux_packages: - youtube-dl - mpv -fedora_packages: - - mtr - - libselinux-python - - ranger - - python3-pip - - python3 - -playbook_version_number: 8998 # should be over ninethousand +playbook_version_number: 8999 # should be over ninethousand playbook_version_path: 'base-packages_roles-ansible_github.version'