]> freie-schul-it.de Git - fsit_smgt.git/commitdiff
mit block versuchen
authorUllli <ullli@freie-schul-it.de>
Fri, 24 Apr 2026 16:28:28 +0000 (18:28 +0200)
committerUllli <ullli@freie-schul-it.de>
Fri, 24 Apr 2026 16:28:28 +0000 (18:28 +0200)
tasks/bootstrap.yml
tasks/main.yml

index e6dd0c410c0cf57ae2b7686d8cd9e51451694441..c5e37da544552a9dd780bf72a2456d234562487a 100644 (file)
@@ -1,67 +1,68 @@
 ---
 ---
-- name: Remove apt-config-file derived from preseeding
-  ansible.builtin.file:
-    path: /etc/apt/apt.conf
-    state: absent
-  when: ("baremetal" in group_names)
-- name: Create apt-proxy config file
-  ansible.builtin.template:
-    src: apt-proxy_01proxy.j2
-    dest: /etc/apt/apt.conf.d/01proxy
-  when: ("DMZ" not in group_names)
-- name: Remove apt-config-file only for aptproxy
-  ansible.builtin.file:
-    path: /etc/apt/apt.conf.d/01proxy
-    state: absent
-  when: ("aptproxy" in inventory_hostname)
-- name: Copy apt-unattended-upgrades config file
-  ansible.builtin.copy:
-    src: apt-unattended-upgrades_10periodic
-    dest: /etc/apt/apt.conf.d/10periodic
-- name: Update and upgrade apt packages
-  ansible.builtin.apt:
-    update_cache: true
-    upgrade: true
-    autoremove: true
-- name: Install core-packages
-  ansible.builtin.apt:
-    pkg:
-      - sudo
-      - gnupg
-      - htop
-      - ncdu
-      - vim
-      - tmux
-      - gnupg2
-      - nethogs
-      - iftop
-      - rsync
-      - ripgrep
-- name: Install core-packages for bare-metal-server
-  ansible.builtin.apt:
-    pkg:
-      - inxi
-  when: ("baremetal" in group_names)
-- name: Install core-packages for server in DMZ
-  ansible.builtin.apt:
-    pkg:
-      - fail2ban
-  when: ("DMZ" in group_names)
-- name: Add ansible user to server
-  ansible.builtin.user:
-    name: ansible
-    shell: /bin/bash
-- name: Allow "ansible"-user to have passwordless sudo
-  ansible.builtin.copy:
-    src: sudo_ansible
-    dest: /etc/sudoers.d/ansible
-    owner: root
-    group: root
-    mode: "0440"
-- name: Add installbox-ansible-user _public_ ssh-key to the servers authorized_keys file
-  ansible.posix.authorized_key:
-    user: ansible
-    state: present
-    manage_dir: true
-    key: "{{ lookup('file', '/home/ansible/.ssh/id_ed25519.pub') }}"
-
+- block:
+  - name: Remove apt-config-file derived from preseeding
+    ansible.builtin.file:
+      path: /etc/apt/apt.conf
+      state: absent
+    when: ("baremetal" in group_names)
+  - name: Create apt-proxy config file
+    ansible.builtin.template:
+      src: apt-proxy_01proxy.j2
+      dest: /etc/apt/apt.conf.d/01proxy
+    when: ("DMZ" not in group_names)
+  - name: Remove apt-config-file only for aptproxy
+    ansible.builtin.file:
+      path: /etc/apt/apt.conf.d/01proxy
+      state: absent
+    when: ("aptproxy" in inventory_hostname)
+  - name: Copy apt-unattended-upgrades config file
+    ansible.builtin.copy:
+      src: apt-unattended-upgrades_10periodic
+      dest: /etc/apt/apt.conf.d/10periodic
+  - name: Update and upgrade apt packages
+    ansible.builtin.apt:
+      update_cache: true
+      upgrade: true
+      autoremove: true
+  - name: Install core-packages
+    ansible.builtin.apt:
+      pkg:
+        - sudo
+        - gnupg
+        - htop
+        - ncdu
+        - vim
+        - tmux
+        - gnupg2
+        - nethogs
+        - iftop
+        - rsync
+        - ripgrep
+  - name: Install core-packages for bare-metal-server
+    ansible.builtin.apt:
+      pkg:
+        - inxi
+    when: ("baremetal" in group_names)
+  - name: Install core-packages for server in DMZ
+    ansible.builtin.apt:
+      pkg:
+        - fail2ban
+    when: ("DMZ" in group_names)
+  - name: Add ansible user to server
+    ansible.builtin.user:
+      name: ansible
+      shell: /bin/bash
+  - name: Allow "ansible"-user to have passwordless sudo
+    ansible.builtin.copy:
+      src: sudo_ansible
+      dest: /etc/sudoers.d/ansible
+      owner: root
+      group: root
+      mode: "0440"
+  - name: Add installbox-ansible-user _public_ ssh-key to the servers authorized_keys file
+    ansible.posix.authorized_key:
+      user: ansible
+      state: present
+      manage_dir: true
+      key: "{{ lookup('file', '/home/ansible/.ssh/id_ed25519.pub') }}"
+  remote_user: root  
index 15c15c0f881b64c22f2f7cc72e9fb56eec26e6fa..77e884233fa7378ea07666fd001005258ce21529 100644 (file)
@@ -1,7 +1,6 @@
 ---
 - name: Include bootstrap
   ansible.builtin.include_tasks: bootstrap.yml
 ---
 - name: Include bootstrap
   ansible.builtin.include_tasks: bootstrap.yml
-  remote_user: root
 - name: OpenLDAP-Server
   ansible.builtin.include_tasks: openldap.yml
   when: ldap in group_names 
 - name: OpenLDAP-Server
   ansible.builtin.include_tasks: openldap.yml
   when: ldap in group_names