From d3a318adab25465fbf20858ca2f18126bc070ae0 Mon Sep 17 00:00:00 2001 From: Rottler Tamas Date: Wed, 7 Sep 2022 02:40:51 +0200 Subject: [PATCH] ubuntu20.04 --- tasks/main.yml | 151 ++++++++++++++++++++++++++++--------------------- 1 file changed, 88 insertions(+), 63 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 1ddea2b..ee6e453 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -25,6 +25,20 @@ state: absent purge: yes +- name: remove ubuntu cloud init, etc. + tags: apt + apt: + name: + - cloud-init + - cloud-guest-utils + - cloud-initramfs-dyn-netconf + - cloud-initramfs-copymods + - netplan.io + state: absent + purge: yes + when: + - ansible_distribution == "Ubuntu" + - name: apt sources.list jessie tags: apt copy: @@ -58,8 +72,7 @@ src: sources.list.bullseye dest: /etc/apt/sources.list when: - - ansible_distribution == "Debian" - - ansible_distribution_major_version == "11" + - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) - name: apt.conf allow unauthenticated jessie tags: apt @@ -102,57 +115,56 @@ - name: install common packages for all opsys versions tags: apt apt: - name: "{{ item }}" + name: + - bind9-host + - bzip2 + - curl + - file + - git + - bsd-mailx + - iotop + - libpam-systemd + - locales + - lsof + - make + - mc + - mlocate + - mtr-tiny + - ngrep + - ntp + - ntpdate + - openssl + - parted + - patch + - postfix + - psmisc + - pwgen + - rename + - rsync + - screen + - strace + - subversion + - sysstat + - tcpdump + - telnet + - unzip + - vim + - w3m + - xz-utils + - zip + - libfile-slurp-perl + - libjson-perl + - net-tools + - man + - ifupdown state: present - with_items: - - bind9-host - - bzip2 - - curl - - file - - git - - bsd-mailx - - iotop - - libpam-systemd - - locales - - lsof - - make - - mc - - mlocate - - mtr-tiny - - ngrep - - ntp - - ntpdate - - openssl - - parted - - patch - - postfix - - psmisc - - pwgen - - rename - - rsync - - screen - - strace - - subversion - - sysstat - - tcpdump - - telnet - - unzip - - vim - - w3m - - xz-utils - - zip - - libfile-slurp-perl - - libjson-perl - - net-tools - - man - name: install packages for debian buster and older tags: apt apt: - name: "{{ item }}" + name: + - dnsutils state: present - with_items: - - dnsutils when: - ansible_distribution == "Debian" - ansible_distribution_major_version|int() <= 10 @@ -160,13 +172,12 @@ - name: install packages for debian bullseye and newer tags: apt apt: - name: "{{ item }}" + name: + - bind9-utils state: present - with_items: - - bind9-utils when: - - ansible_distribution == "Debian" - - ansible_distribution_major_version|int() <= 11 + - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or + (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20) - name: open-vm-tools apt: @@ -192,8 +203,7 @@ authorized_key: user: root state: absent - key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDWZi5nTI6zo3+cgGx5l163pEQXJ3aUyerqbHfQl9p8aB2bbe+vQl+Uc2Vrv8fvytAZizjPIIYdW5RqFAXrbNP+OpyFAONNZpX0omB8HLoHzOnmWpaCjMZp9XAdvWPknWFWWkwR5G5rbP5+dKeREzl4cAvW4GauEjaK4kUJF3K2HumVF6U3bzyDwnI+7h0zEbHddSOwAP1Opzla+WSdF+ZsiMdcVZE/mFxzd8sv1ZoO36sVZ1vItEAcols4qEAfwW8Gk/UjXI1XFRD1UrksAUxAc4ypu5oBVWtjMa429ZrCRbH2iU+TPbuUSXHJQMgTqsUgHrS9XkuS3EdbPA/aDMD1jhoYz2zyfAoCGdEBOuATlaoCOpOeSc9XIsasdVNwvtX2LCTlQe+LLOQzKiLaHEr/QmnLs8es8b68wtDlFIA2QAXYIfs8l+gBv3t3BIw7VPbMe8nb6hbTHFObDlVCyvXO2/6ZkOfRMgswFsQnGAqciowPxsjVer+I5hEBCMHgb6pxcUECxcxsc9P/w/z9LxGts9Ozyq55jzWMwvnFdarkzpMfWtt3QX7XG5B8OD4ghuMkX60GgvT7v1E7yTI/JtwXrsAc6jl1Qo4+TDdEYuBXe/LqyQzQ7GD1OoGRHIKCWyAQ9JiHcbUYX9p+vafXf0l1jelSg3O+cU+q+oZdGP178w== root@kavics' - # XXX + key: "{{ mgmt_ssh_key }}" - name: copy pf6 package tags: pf6 @@ -234,8 +244,16 @@ src: default_grub.patch.stretch dest: /etc/default/grub when: - - ansible_distribution == "Debian" - - ansible_distribution_major_version|int() >= 9 + - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 9) + +- name: grub defaults, stretch+ + tags: grub + lineinfile: + path: /etc/default/grub + regexp: "^GRUB_CMDLINE_LINUX=" + line: 'GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"' + when: + - (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20) - name: update-grub tags: grub @@ -275,8 +293,8 @@ regexp: "noquery limited" replace: "noquery" when: - - ansible_distribution == "Debian" - - ansible_distribution_major_version|int() >= 9 + - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 9) or + (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20) - name: postfix master.cf jessie @@ -304,16 +322,23 @@ src: postfix_master.cf.patch.bullseye dest: /etc/postfix/master.cf when: - - ansible_distribution == "Debian" - - ansible_distribution_major_version|int() == 11 + - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) -- name: postfix relay +- name: postfix master.cf ubuntu 20.04 + tags: postfix + patch: + src: postfix_master.cf.patch.ubuntu20.04 + dest: /etc/postfix/master.cf + when: + - (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20) + +- name: postfix relayhost tags: postfix lineinfile: dest: /etc/postfix/main.cf regexp: '^relayhost\s' - line: "relayhost = mail-out.i.hwstudio.hu" - # XXX + line: "relayhost = {{ postfix_relayhost }}" + when: postfix_relayhost is defined - name: pvresize /dev/sdb tags: