]> freie-schul-it.de Git - fsit-cmgt.git/blobdiff - library/bootstrap.yml
Änderungen am DNS für Ubuntu und autoremove für update
[fsit-cmgt.git] / library / bootstrap.yml
index 66493a2a8969c8e58299b99eb104e30005b6922b..0297198d627b9c7b020d609f31f199c09d3c797a 100644 (file)
@@ -1,38 +1,50 @@
 ---
 ---
-   - name: change ansible-user password
-     user:
-       name: ansible
-       update_password: always
-       password: "{{ ansibleuser|password_hash('sha512') }}"
-   - name: hide system-account
-     copy:
-       src: fsit-cmgt/files/gdm-ansible
-       dest: /var/lib/AccountsService/users/ansible
-       #- name: stop automatic remote printer installation
-       #ansible.builtin.systemd:
-       #name: cups-browsed
-       #state: stopped
-       #- name: disable automatic remote printer installation
-       #ansible.builtin.systemd:
-       #name: cups-browsed
-       #enabled: no
-   - name: remove apt-config-file derived from preseeding
-     ansible.builtin.file:
-       path: /etc/apt/apt.conf
-       state: absent
-   - name: copy new apt-proxy config file to apt.conf.d-dir
-     ansible.builtin.template:
-       src: files/apt-proxy_01proxy.j2
-       dest: /etc/apt/apt.conf.d/01proxy
-   - name: Update and upgrade apt packages
-     apt:
-       update_cache: yes
-       upgrade: yes
-   - name: install core-packages
-     apt:
-       pkg:
-       - htop
-       - glances
-       - inxi
-       - bmon   
+- name: change ansible-user password
+  ansible.builtin.user:
+    name: ansible
+    update_password: always
+    password: "{{ ansibleuser|password_hash('sha512') }}"
+- name: hide system-account
+  ansible.builtin.lineinfile:
+    path: /var/lib/AccountsService/users/ansible
+    regex: 'SystemAccount=*'
+    line: 'SystemAccount=true'
+- name: remove apt-config-file derived from preseeding
+  ansible.builtin.file:
+    path: /etc/apt/apt.conf
+    state: absent
+- name: copy new apt-proxy config file to apt.conf.d-dir
+  ansible.builtin.copy:
+    dest: /etc/apt/apt.conf.d/01proxy
+    content: |
+      Acquire::http { Proxy "http://{{ aptproxy }}:3142"; };
+      Acquire::https { Proxy "https://"; };
+- name: prepare ubuntu-DNS for working in local network
+  file:
+    src: /run/systemd/resolve/resolv.conf
+    dest: /etc/resolv.conf
+    state: link
+    force: yes
+  when: ansible_facts['distribution'] == 'Ubuntu'
+- name: Update and upgrade apt packages
+  apt:
+    update_cache: true
+    upgrade: true
+    autoremove: true
+- name: install core-packages
+  apt:
+    pkg:
+    - htop
+    - glances
+    - inxi
+    - bmon
+    - vim
+#- name: stop automatic remote printer installation
+#  ansible.builtin.systemd:
+#    name: cups-browsed
+#    state: stopped
+#- name: disable automatic remote printer installation
+#  ansible.builtin.systemd:
+#    name: cups-browsed
+#    enabled: no
 ...
 ...