Skip to content
Snippets Groups Projects
Commit 67e4670f authored by ale's avatar ale
Browse files

Remove all stretch-related configuration switches

No need to support those anymore. Fixes issue #78.
parent 04097355
No related branches found
No related tags found
1 merge request!130Remove all stretch-related configuration switches
Pipeline #7521 passed
...@@ -5,7 +5,7 @@ Requires=mtail.socket ...@@ -5,7 +5,7 @@ Requires=mtail.socket
[Service] [Service]
Type=simple Type=simple
# Systemd will pass mtail.socket as FD 3. # Systemd will pass mtail.socket as FD 3.
ExecStart=/usr/bin/mtail -progs /etc/mtail -logtostderr -port 3903 -logfds 3 ExecStart=/usr/bin/mtail --progs /etc/mtail --logtostderr --port 3903 --logs /dev/fd/3
Restart=on-failure Restart=on-failure
User=mtail User=mtail
......
[Unit]
Description=MTail
Requires=mtail.socket
[Service]
Type=simple
# Systemd will pass mtail.socket as FD 3.
ExecStart=/usr/bin/mtail --progs /etc/mtail --logtostderr --port 3903 --logs /dev/fd/3
Restart=on-failure
User=mtail
# Limit memory leaks
MemoryMax=1G
ExecStartPost=+/bin/sh -c "echo 0 > /sys/fs/cgroup/memory/system.slice/%n/memory.swappiness"
[Install]
WantedBy=multi-user.target
ARGS="--collector.systemd.unit-blacklist=.+(\.device|\.swap|\.mount|\.scope|\.slice|\.target)"
ARGS="--collectors.enabled=conntrack,diskstats,entropy,filefd,filesystem,hwmon,loadavg,meminfo,netdev,netstat,sockstat,stat,systemd,textfile,time,uname,vmstat \
--collector.diskstats.ignored-devices=^(ram|loop|fd)\d+$ \
--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|run)($|/) \
--collector.textfile.directory=/var/lib/prometheus/node-exporter \
--collector.systemd.unit-blacklist=^.*\.(device|swap|mount)$"
ARGS="--collector.systemd.unit-blacklist=.+(\.device|\.swap|\.mount|\.scope|\.slice|\.target)"
...@@ -76,26 +76,7 @@ ...@@ -76,26 +76,7 @@
- restic - restic
- runcron - runcron
- acpid - acpid
- name: Install Stretch packages
apt:
name: "{{ packages }}"
state: present
vars:
packages:
- apt-transport-https
- liblz4-tool
- python-docker
when: float_debian_dist == 'stretch'
- name: Install Buster packages
apt:
name: "{{ packages }}"
state: present
vars:
packages:
- lz4 - lz4
when: float_debian_dist == 'buster'
- name: Install extra packages - name: Install extra packages
apt: apt:
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
# Audit configuration on Debian stretch uses augenrules by default, so # Audit configuration on Debian stretch uses augenrules by default, so
# we copy our rules in /etc/audit/rules.d. # we copy our rules in /etc/audit/rules.d.
# TODO: evaluate whether we still need this.
- name: Auditd installed - name: Auditd installed
apt: apt:
name: "{{ packages }}" name: "{{ packages }}"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- name: Install prometheus config files in /etc/default - name: Install prometheus config files in /etc/default
copy: copy:
src: "{{ 'node-exporter.default' if ansible_distribution_release == 'stretch' else 'node-exporter.default.buster' }}" src: "node-exporter.default"
dest: "/etc/default/prometheus-node-exporter" dest: "/etc/default/prometheus-node-exporter"
notify: notify:
- reload prometheus-node-exporter - reload prometheus-node-exporter
......
...@@ -8,17 +8,9 @@ ...@@ -8,17 +8,9 @@
dest: "/etc/apt/preferences.d/99float-syslog" dest: "/etc/apt/preferences.d/99float-syslog"
when: float_debian_dist == 'buster' when: float_debian_dist == 'buster'
# Install rsyslog from the backports repository. This isn't strictly - name: Install rsyslog packages
# necessary but it is done to have the same version of rsyslog on all
# hosts, including the log-collector.
#
# This sources.list check must use float_debian_dist because otherwise
# Ansible complains about the unknown source on dist upgrades.
# TODO: drop this check when stretch is obsolete.
- name: Install rsyslog packages from backports
apt: apt:
name: "{{ packages }}" name: "{{ packages }}"
default_release: "{{ 'stretch-backports' if float_debian_dist == 'stretch' else '' }}"
state: present state: present
vars: vars:
packages: packages:
...@@ -34,7 +26,7 @@ ...@@ -34,7 +26,7 @@
- name: Install mtail systemd unit - name: Install mtail systemd unit
copy: copy:
src: "{{ 'mtail.service' if ansible_distribution_release == 'stretch' else 'mtail.service.buster' }}" src: "mtail.service"
dest: "/etc/systemd/system/mtail.service" dest: "/etc/systemd/system/mtail.service"
notify: restart mtail notify: restart mtail
......
...@@ -12,10 +12,6 @@ HostKey /etc/ssh/ssh_host_{{ key_type }}_key ...@@ -12,10 +12,6 @@ HostKey /etc/ssh/ssh_host_{{ key_type }}_key
HostCertificate /etc/ssh/ssh_host_{{ key_type }}_key-cert.pub HostCertificate /etc/ssh/ssh_host_{{ key_type }}_key-cert.pub
{% endfor %} {% endfor %}
{% if ansible_distribution_release == 'stretch' %}
UsePrivilegeSeparation sandbox
{% endif %}
# Ciphers and MACs # Ciphers and MACs
KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256 KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
......
- name: Remove docker.com GPG key
apt_key:
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
url: https://download.docker.com/linux/debian/gpg
state: absent
- name: Remove docker packages
apt:
name: "{{ packages }}"
state: absent
vars:
packages:
- docker-ce
- systemd-docker
- name: Remove docker files
file:
dest: "{{ item }}"
state: absent
with_items:
- /etc/apt/sources.list.d/download_docker_com_linux_debian.list
- /etc/docker
...@@ -3,13 +3,6 @@ ...@@ -3,13 +3,6 @@
- set_fact: - set_fact:
container_runtime: "podman" container_runtime: "podman"
- set_fact:
container_runtime: "docker"
when: "ansible_distribution_release == 'stretch'"
- include_tasks: buster_upgrade.yml
when: "ansible_distribution_release == 'buster'"
- include_tasks: docker.yml - include_tasks: docker.yml
when: "container_runtime == 'docker'" when: "container_runtime == 'docker'"
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
register: mariadb_systemd_unit register: mariadb_systemd_unit
- name: Bootstrap data directory - name: Bootstrap data directory
shell: "/usr/bin/mysql_install_db --defaults-file={{ mariadb_config }} --datadir={{ mariadb_data_dir }} --user=mysql --auth-root-authentication-method=socket {{ ansible_distribution_release == 'stretch' and '--skip-auth-anonymous-user' or '' }} && date > {{ mariadb_data_dir }}/.float-bootstrap-ok" shell: "/usr/bin/mysql_install_db --defaults-file={{ mariadb_config }} --datadir={{ mariadb_data_dir }} --user=mysql --auth-root-authentication-method=socket && date > {{ mariadb_data_dir }}/.float-bootstrap-ok"
args: args:
creates: "{{ mariadb_data_dir }}/.float-bootstrap-ok" creates: "{{ mariadb_data_dir }}/.float-bootstrap-ok"
......
...@@ -4,11 +4,7 @@ Description=Prometheus exporter for MySQL server (%I) ...@@ -4,11 +4,7 @@ Description=Prometheus exporter for MySQL server (%I)
[Service] [Service]
Restart=always Restart=always
User=prometheus User=prometheus
{% if ansible_distribution_release == 'stretch' %}
ExecStart=/usr/bin/prometheus-mysqld-exporter -web.listen-address {{ mariadb_metrics_address }}:{{ mariadb_metrics_port }} -config.my-cnf {{ mariadb_metrics_config }} -collect.info_schema.tables=false -collect.info_schema.tablestats=false
{% else %}
ExecStart=/usr/bin/prometheus-mysqld-exporter --web.listen-address {{ mariadb_metrics_address }}:{{ mariadb_metrics_port }} --config.my-cnf {{ mariadb_metrics_config }} --no-collect.info_schema.tables --no-collect.info_schema.tablestats ExecStart=/usr/bin/prometheus-mysqld-exporter --web.listen-address {{ mariadb_metrics_address }}:{{ mariadb_metrics_port }} --config.my-cnf {{ mariadb_metrics_config }} --no-collect.info_schema.tables --no-collect.info_schema.tablestats
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
...@@ -8,15 +8,8 @@ ...@@ -8,15 +8,8 @@
dest: /tmp/test-config.yml dest: /tmp/test-config.yml
content: "{{ vars|to_nice_yaml }}" content: "{{ vars|to_nice_yaml }}"
- name: Setup test Docker image
docker_image:
name: registry.git.autistici.org/ai3/float:integration-test
force: true
when: "ansible_distribution_release == 'stretch'"
- name: Setup test Docker image - name: Setup test Docker image
command: "podman pull registry.git.autistici.org/ai3/float:integration-test" command: "podman pull registry.git.autistici.org/ai3/float:integration-test"
when: "ansible_distribution_release != 'stretch'"
- name: Run tests - name: Run tests
command: docker run --net host --mount type=bind,source=/tmp/test-config.yml,destination=/test-config.yml registry.git.autistici.org/ai3/float:integration-test command: docker run --net host --mount type=bind,source=/tmp/test-config.yml,destination=/test-config.yml registry.git.autistici.org/ai3/float:integration-test
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment