From cf4968a4a812540f9cf443e7052a4b5818e66293 Mon Sep 17 00:00:00 2001 From: Marcin Bojko Date: Sat, 16 Nov 2019 14:35:23 +0100 Subject: [PATCH] Version 1.2.7 002 001 --- CHANGELOG.md | 14 +++++++ README.md | 7 ++-- linux_mint.yaml | 105 ++++++++++++++++++++++++++++++------------------ variables.yml | 52 +++++++++++++++--------- 4 files changed, 117 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 265f99b..c838242 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog "linux_mint" +## Version 1.2.7 2019-11-16 + +* [APPLICATION] upgraded dive to version 0.9.1 +* [APPLICATION] upgraded `boostnote` to version 0.13.0 +* [APPLICATION] upgraded `vault` to version 1.3.0 +* [APPLICATION] upgraded `terraform` to version 0.12.15 +* [APPLICATION] added Helm 3.0 as `helm3` in downloaded files +* deleted `enable_bbr` and `modify_grub` variables +* introduced `change_sysctl` variable,, defaults to true +* removed `modify grub` section, on kernel 5.0 it is pointless +* new variables section `sysctl` +* moved `bbr congestion control` and `vm.swappiness` from standalone settings into `sysctl` section +* allowed 3-rd party deb applications to fail during install - due to possible internet connection problems when handling big files + ## Version 1.2.6 2019-11-09 * [PACKAGES] added `multitail` diff --git a/README.md b/README.md index 19c688a..bd24b6e 100644 --- a/README.md +++ b/README.md @@ -29,13 +29,13 @@ ## Usage ```bash -ansible-playbook ../linux_mint.yaml -i myhost.lst +ansible-playbook ./linux_mint.yaml -i myhost.lst ``` or change user you're using ```bash -ansible-playbook ../linux_mint.yaml -i myhost.lst --extra-vars "ansible_ssh_user=myuser" +ansible-playbook ./linux_mint.yaml -i myhost.lst --extra-vars "ansible_ssh_user=myuser" ``` or start at specific step @@ -64,8 +64,7 @@ For these variables in playbook: |install_mitogen|true|install mitogen for ansible and change ansible settings| |config_ansible|true|change ansible settings in ansible.cfg| |config_dconf|true|change dconf settings| -|enable_bbr|true| enable TCP BBR congestion control| -|modify_grub|false|don't touch grub settings, unless told so| +|config_sysctl|true|change sysctl settings| |active_user|"{{ ansible_ssh_user }}"|user for which you're setting folders. By default taken from group_vars| |codename|bionic|codename of version you're setting PPAs for| |retries_count|4|how many retries| diff --git a/linux_mint.yaml b/linux_mint.yaml index a988f7a..93c1051 100644 --- a/linux_mint.yaml +++ b/linux_mint.yaml @@ -12,8 +12,7 @@ install_mitogen: true # true by default config_ansible: true # do changes in change ansible.cfg config_dconf: true # do changes in dconf editor - enable_bbr: true # enable TCP BBR congestion control - modify_grub: false # don't touch grub settings, unless told to do so + config_sysctl: true active_user: "{{ ansible_ssh_user }}" # user for which you're setting folders. By default taken from group_vars codename: bionic # codename of version you're setting PPAs for retries_count: 4 # how many retries @@ -39,8 +38,8 @@ gather_timeout: 30 retries: "{{ retries_count }}" delay: "{{ delay_time }}" - register: setup_status - until: setup_status is success + register: r_setup_status + until: r_setup_status is success tags: - assert # free space for stuff @@ -208,6 +207,7 @@ register: r_apt_deb until: r_apt_deb is success any_errors_fatal: false + ignore_errors: true when: install_deb == true tags: - packages @@ -254,14 +254,18 @@ - apps - name: download_and_unarchive unarchive: - src: "{{ item.urls }}" + src: "{{ item.url }}" dest: "{{ bin_path }}" keep_newer: true mode: +x remote_src: yes extra_opts: [-j] when: item.skip_tree == false - loop: "{{ down }}" + retries: "{{ retries_count }}" + delay: "{{ delay_time }}" + register: r_unarchive + until: r_unarchive is success + loop: "{{ downloads }}" tags: - base - downloads @@ -269,7 +273,7 @@ # Download 3-rd party software and unarchive it (flatten archive folder tree) to `bin_path` setting +x - name: download_unarchive_and_flatten unarchive: - src: "{{ item.urls }}" + src: "{{ item.url }}" dest: "{{ bin_path }}" keep_newer: true mode: +x @@ -279,7 +283,11 @@ - LICENSE - README.md when: item.skip_tree == true - loop: "{{ down }}" + loop: "{{ downloads }}" + retries: "{{ retries_count }}" + delay: "{{ delay_time }}" + register: r_unarchive_flatten + until: r_unarchive_flatten is success tags: - base - downloads @@ -287,11 +295,15 @@ # Download 3-rd party software to `bin_path` setting +x - name: download_files get_url: - url: "{{ item.urls }}" + url: "{{ item.url }}" dest: "{{ bin_path }}/{{ item.destination }}" mode: 0755 force: yes loop: "{{ files }}" + retries: "{{ retries_count }}" + delay: "{{ delay_time }}" + register: r_download_files + until: r_download_files is success tags: - base - downloads @@ -400,6 +412,7 @@ - downloads - apps - mitogen + - ansible # start ansible block - block: - name: check_if_ansible_cfg_exists @@ -427,6 +440,8 @@ until: r_change_ansible_options is success when: ansible_exists == true when: config_ansible == true + tags: + - ansible # start vscode extensions block - name: install_vscode_extensions block: @@ -488,18 +503,18 @@ state: restarted enabled: true when: r_set_avahi_config is changed and r_set_avahi_config is defined - - name: set_grub_defaults_for_SSD - lineinfile: - dest: /etc/default/grub - regexp: '^GRUB_CMDLINE_LINUX_DEFAULT=' - line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=deadline"' - backrefs: true - any_errors_fatal: false - register: grub_default - when: modify_grub == true - - name: grub_update - shell: update-grub2 - when: grub_default.changed and modify_grub == true +# - name: set_grub_defaults_for_SSD +# lineinfile: +# dest: /etc/default/grub +# regexp: '^GRUB_CMDLINE_LINUX_DEFAULT=' +# line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=deadline"' +# backrefs: true +# any_errors_fatal: false +# register: grub_default +# when: modify_grub == true +# - name: grub_update +# shell: update-grub2 +# when: grub_default.changed and modify_grub == true - name: enable_timeshift_in_rsync_mode shell: timeshift --rsync --yes args: @@ -534,26 +549,38 @@ state: restarted enabled: true when: r_create_fstrim_override.changed - - name: sysctl_change_qdisc + - name: sysctl_changes sysctl: - name: net.core.default_qdisc - value: fq - state: present - reload: no - when: enable_bbr == true - - name: sysctl_change_congestion_control - sysctl: - name: net.ipv4.tcp_congestion_control - value: bbr - state: present - reload: yes - when: enable_bbr == true - - name: sysctl_change_vm_swappines - sysctl: - name: vm.swappiness - value: "{{ 1|int }}" - state: present + name: "{{ item.name|string }}" + value: "{{ item.value|string }}" + state: "{{ item.state|string }}" reload: yes + loop: "{{ sysctl }}" + register: r_sysctl_changes + retries: "{{ retries_count }}" + delay: "{{ delay_time }}" + until: r_sysctl_changes is success + when: config_sysctl == true|bool +# - name: sysctl_change_qdisc +# sysctl: +# name: net.core.default_qdisc +# value: fq +# state: present +# reload: no +# when: enable_bbr == true +# - name: sysctl_change_congestion_control +# sysctl: +# name: net.ipv4.tcp_congestion_control +# value: bbr +# state: present +# reload: yes +# when: enable_bbr == true +# - name: sysctl_change_vm_swappines +# sysctl: +# name: vm.swappiness +# value: "{{ 1|int }}" +# state: present +# reload: yes - name: change_alternatives alternatives: name: "{{ item.name }}" diff --git a/variables.yml b/variables.yml index 9c7f1c2..6f28d50 100644 --- a/variables.yml +++ b/variables.yml @@ -285,13 +285,13 @@ deb: - https://release.axocdn.com/linux/gitkraken-amd64.deb - https://releases.hashicorp.com/vagrant/2.2.6/vagrant_2.2.6_x86_64.deb - https://launchpad.net/ubuntu/+archive/primary/+files/libgoo-canvas-perl_0.06-2ubuntu3_amd64.deb -- https://github.com/BoostIO/boost-releases/releases/download/v0.12.1-1/boostnote_0.12.1-1_amd64.deb +- https://github.com/BoostIO/boost-releases/releases/download/v0.13.0/boostnote_0.13.0_amd64.deb - https://github.com/Eugeny/terminus/releases/download/v1.0.92/terminus-1.0.92-linux.deb - https://github.com/TheGoddessInari/hamsket/releases/download/0.5.20/Rambox_0.5.20_amd64.deb - https://download.teamviewer.com/download/linux/teamviewer_amd64.deb - https://github.com/kubernetes/minikube/releases/download/v1.5.2/minikube_1.5.2.deb - http://kdl.cc.ksosoft.com/wps-community/download/8865/wps-office_11.1.0.8865_amd64.deb -- https://github.com/wagoodman/dive/releases/download/v0.9.0/dive_0.9.0_linux_amd64.deb +- https://github.com/wagoodman/dive/releases/download/v0.9.1/dive_0.9.1_linux_amd64.deb flatpak: - name: https://flathub.org/repo/appstream/com.getpostman.Postman.flatpakref pip: @@ -301,33 +301,37 @@ pip: - pywinrm[credssp] - pypsrp - yamllint -down: -- urls: https://releases.hashicorp.com/packer/1.4.5/packer_1.4.5_linux_amd64.zip +downloads: +- url: https://releases.hashicorp.com/packer/1.4.5/packer_1.4.5_linux_amd64.zip destination: packer skip_tree: false -- urls: https://get.helm.sh/helm-v2.14.3-linux-amd64.tar.gz +- url: https://get.helm.sh/helm-v2.14.3-linux-amd64.tar.gz destination: helm skip_tree: true skip_levels: 1 -- urls: https://releases.hashicorp.com/terraform/0.12.13/terraform_0.12.13_linux_amd64.zip +- url: https://get.helm.sh/helm-v3.0.0-linux-arm64.tar.gz + destination: helm3 + skip_tree: true + skip_levels: 1 +- url: https://releases.hashicorp.com/terraform/0.12.15/terraform_0.12.15_linux_amd64.zip destination: terraform skip_tree: false -- urls: https://releases.hashicorp.com/vault/1.2.4/vault_1.2.4_linux_amd64.zip +- url: https://releases.hashicorp.com/vault/1.3.0/vault_1.3.0_linux_amd64.zip destination: vault skip_tree: false -- urls: https://github.com/wata727/tflint/releases/download/v0.12.1/tflint_linux_amd64.zip +- url: https://github.com/wata727/tflint/releases/download/v0.12.1/tflint_linux_amd64.zip destination: tflint skip_tree: false files: -- urls: https://github.com/docker/compose/releases/download/1.24.1/docker-compose-Linux-x86_64 +- url: https://github.com/docker/compose/releases/download/1.24.1/docker-compose-Linux-x86_64 destination: docker-compose -- urls: https://github.com/bcicen/ctop/releases/download/v0.7.2/ctop-0.7.2-linux-amd64 +- url: https://github.com/bcicen/ctop/releases/download/v0.7.2/ctop-0.7.2-linux-amd64 destination: ctop -- urls: https://github.com/rancher/rke/releases/download/v0.3.2/rke_linux-amd64 +- url: https://github.com/rancher/rke/releases/download/v0.3.2/rke_linux-amd64 destination: rke -- urls: https://github.com/dannagle/PacketSender/releases/download/v6.2.3/PacketSender_Linux_x64_v6.2.3.AppImage +- url: https://github.com/dannagle/PacketSender/releases/download/v6.2.3/PacketSender_Linux_x64_v6.2.3.AppImage destination: packetsender -- urls: https://github.com/rancher/k3s/releases/download/v0.10.2/k3s +- url: https://github.com/rancher/k3s/releases/download/v0.10.2/k3s destination: k3s mitogen: config: @@ -411,10 +415,22 @@ vscode: - wholroyd.jinja - yzane.markdown-pdf - timonwong.shellcheck +sysctl: + # enable bbr congestion for tcp + - name: net.core.default_qdisc + value: fq + state: present + - name: net.ipv4.tcp_congestion_control + value: bbr + state: present + # decrease swappiness when you have plenty of RAM + - name: vm.swappiness + value: 1 + state: present alternatives: -- name: editor - path: /usr/bin/mcedit - variable: EDITOR + - name: editor + path: /usr/bin/mcedit + variable: EDITOR global_env: -- name: EDITOR - value: mcedit \ No newline at end of file + - name: EDITOR + value: mcedit \ No newline at end of file