From 011a0852bb62a7a9599830ec33a9eaadfd7d7a1d Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Wed, 13 Aug 2025 17:11:09 +0200 Subject: [PATCH] proxmox: remove tasks done by debian role --- roles/proxmox/handlers/main.yml | 10 --------- roles/proxmox/tasks/main.yml | 29 ------------------------ roles/proxmox/tasks/network.yml | 40 --------------------------------- 3 files changed, 79 deletions(-) diff --git a/roles/proxmox/handlers/main.yml b/roles/proxmox/handlers/main.yml index a48f969..2da6a81 100644 --- a/roles/proxmox/handlers/main.yml +++ b/roles/proxmox/handlers/main.yml @@ -1,7 +1,3 @@ -- name: reboot - reboot: - when: "'handler' not in ansible_skip_tags" - - name: reload interfaces command: ifreload -a when: "'handler' not in ansible_skip_tags" @@ -12,12 +8,6 @@ state: reloaded when: "'handler' not in ansible_skip_tags" -- name: reload sshd - service: - name: sshd - state: reloaded - when: "'handler' not in ansible_skip_tags" - - name: update package cache package: update_cache: yes diff --git a/roles/proxmox/tasks/main.yml b/roles/proxmox/tasks/main.yml index 1141b87..98e02fd 100644 --- a/roles/proxmox/tasks/main.yml +++ b/roles/proxmox/tasks/main.yml @@ -3,44 +3,15 @@ set_fact: is_primary: '{{ nodes is defined and inventory_hostname == (nodes | map(attribute="inventory_hostname") | sort | first) }}' -- name: Set hostname - hostname: - name: '{{ inventory_hostname }}' - - name: Set up hosts file template: dest: /etc/hosts src: hosts.j2 -- name: Set up resolv.conf - template: - dest: /etc/resolv.conf - src: resolv.conf.j2 - mode: 0644 - -- name: Disable SSH password authentication - lineinfile: - path: /etc/ssh/sshd_config - regexp: '^#?{{ item.key }}' - line: '{{ item.key }} {{ item.value }}' - loop: - - key: PasswordAuthentication - value: 'no' - - key: PermitRootLogin - value: 'prohibit-password' - notify: reload sshd - - include_tasks: network.yml - include_tasks: repositories.yml -- name: Install essential packages - package: - name: - - git - - vim - - tmux - - name: Set up sysctls copy: dest: /etc/sysctl.d/local.conf diff --git a/roles/proxmox/tasks/network.yml b/roles/proxmox/tasks/network.yml index 75d0fae..d01656d 100644 --- a/roles/proxmox/tasks/network.yml +++ b/roles/proxmox/tasks/network.yml @@ -1,13 +1,3 @@ -- name: Add rules to rename network interfaces - template: - dest: "/etc/systemd/network/10-{{ item.name }}.link" - src: interface.link.j2 - mode: "0644" - loop: "{{ interfaces | selectattr('mac_address') }}" - loop_control: - label: "{{ item.name }}" - notify: reboot - - name: Set up bridges template: dest: /etc/network/interfaces @@ -21,34 +11,4 @@ src: loopback.intf.j2 notify: reload interfaces -- name: Set up physical interfaces - template: - dest: /etc/network/interfaces.d/ansible.intf - src: ansible.intf.j2 - mode: 0644 - notify: reload interfaces - -- name: Run SSH instance in management VRF - when: interfaces | selectattr('vrf') | selectattr('vrf.name', '==', 'mgmt') - block: - - name: Configure SSH instance in management VRF - copy: - dest: /etc/ssh/ - src: sshd_config.mgmt - mode: 0644 - notify: reboot - - - name: Set up a SSH instance in management VRF - copy: - dest: /etc/systemd/system/ - src: sshd@mgmt.service - mode: 0644 - notify: reboot - - - name: Enable management SSH - service: - name: sshd@mgmt - enabled: yes - notify: reboot - - meta: flush_handlers