--- # A package the role must remove, and the locales tool the role assumes exists # (it does on a stock Ubuntu host). jq (system_baseline_extra_packages) must be absent, so that the role is what installs it, and ed # (system_baseline_extra_remove_packages, on no profile list) must be present, so that the role is what purges it. procps has the sysctl # command verify needs. - name: Prepare hosts: all gather_facts: false tasks: - name: Install packages the role removes and tools it assumes ansible.builtin.apt: name: [telnet, locales, ed, procps] state: present update_cache: true - name: Make sure jq is not installed ansible.builtin.apt: name: jq state: absent - name: Seed /etc/sysctl.conf with keys of the role and lines it must leave alone ansible.builtin.copy: dest: /etc/sysctl.conf mode: "0644" content: | # net.ipv4.tcp_syncookies=1 net.ipv4.tcp_syncookies=1 vm.max_map_count = 262144 net.ipv4.conf.all.accept_redirects = 0