diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..c1648fc --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,2 @@ +skip_list: + - '403' diff --git a/README.md b/README.md index 9f83de8..9d80cc4 100644 --- a/README.md +++ b/README.md @@ -29,5 +29,4 @@ Packages are defined as variable in the ``vars`` Folder. ------------ - Some CI-Testing would be nice. Eg with docker and some common linux distributions. - Meta File for Ansible Galaxy is missing -- Role should be moved to [chaos-bodensee](https://github.com/chaos-bodensee/) - Lint checks? diff --git a/defaults/main.yml b/defaults/main.yml index ba856b3..7b5dd6e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,18 @@ --- +# if you are interested in adding extra packages... do it here! packages_extra: [] # - foo # - bar -upgrade_packages_to_latest_version: false + +# do we want the latest package version or just upgrade manually? +upgrade_packages_to_latest_version: true + +# add eth zurich apt source +add_ethz: true + +# we use vim! +editor_is_vim: true + + +# version management submodules_versioncheck: true diff --git a/tasks/editor.yml b/tasks/editor.yml new file mode 100644 index 0000000..8cafd2b --- /dev/null +++ b/tasks/editor.yml @@ -0,0 +1,7 @@ +--- +- name: vim is our editor + become: true + alternatives: + name: editor + path: /usr/bin/vim.basic + when: editor_is_vim | bool diff --git a/tasks/main.yml b/tasks/main.yml index fa47630..4febafc 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,6 +1,12 @@ --- - include_tasks: versioncheck.yml - when: submodules_versioncheck|bool + when: submodules_versioncheck | bool + +- include_tasks: editor.yml + when: editor_is_vim | bool + +- include_tasks: sources.yml + when: ansible_distribution == 'Debian' - name: Install common base packages [Debian] become: yes @@ -26,18 +32,6 @@ when: ansible_distribution == 'Fedora' -- name: Install some common Debian specific packages - become: yes - apt: - package: - - debian-goodies - - apt-dater-host - - apt-transport-https - state: present - update_cache: yes - cache_valid_time: 43200 - when: ansible_distribution == 'Debian' - - name: install packages for everyone except centos/rhel become: true package: diff --git a/tasks/sources.yml b/tasks/sources.yml new file mode 100644 index 0000000..f5a0063 --- /dev/null +++ b/tasks/sources.yml @@ -0,0 +1,32 @@ +--- +- name: Install some common Debian specific packages + become: yes + apt: + package: + - debian-goodies + - apt-dater-host + - apt-transport-https + state: present + update_cache: yes + cache_valid_time: 43200 + when: ansible_distribution == 'Debian' + + +- name: add eth zurich apt + become: true + apt_repository: + repo: deb https://debian.ethz.ch/debian/ {{ ansible_distribution_release }} main + state: present + when: + - add_ethz | bool + - ansible_distribution == 'Debian' + - ansible_distribution_release == "wheezy" or ansible_distribution_release == "buster" + +- name: iremove eth zurich apt + become: true + apt_repository: + repo: deb-src https://debian.ethz.ch/debian/ {{ ansible_distribution_release }} main + state: absent + when: + - not add_ethz | bool + - ansible_distribution == 'Debian' diff --git a/vars/main.yml b/vars/main.yml index 3233eda..dab4d63 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -2,6 +2,7 @@ base_packages: - tmux - sudo + - fail2ban - sysstat - ethtool - vim @@ -21,6 +22,9 @@ debian_packages: - python-apt - python3-apt - fio + - debian-goodies + - apt-dater-host + - apt-transport-https packages_for_all_except_rhel: - ranger @@ -43,5 +47,5 @@ fedora_packages: - python3-pip - python3 -playbook_version_number: 8953 # should be over ninethousand +playbook_version_number: 8958 # should be over ninethousand playbook_version_path: '/etc/ansible-version/base-packages_ffbsee_or_chaos-bodensee_github.version'