ansible/liebchen.yml

220 lines
6.0 KiB
YAML
Raw Normal View History

2024-02-10 14:50:42 +01:00
- hosts: localhost
2024-02-10 14:33:27 +01:00
tasks:
2024-02-12 15:01:01 +01:00
- name: Disable login screen during install
command: systemctl stop systemd-logind.service
2024-02-12 08:53:23 +01:00
- name: Update apt repo and cache
apt:
update_cache: yes
force_apt_get: yes
cache_valid_time: 0
- name: Upgrade all packages
apt:
upgrade: dist
force_apt_get: yes
2024-02-10 16:40:51 +01:00
2024-02-12 08:51:12 +01:00
- name: Install general packages
2024-02-10 14:33:27 +01:00
apt:
name:
2024-02-10 14:50:42 +01:00
- geany
2024-02-11 14:11:19 +01:00
- nfs-common
- thunderbird
2024-02-10 14:50:42 +01:00
state: latest
2024-02-12 08:51:12 +01:00
- name: Firefox snap
command: snap install firefox
2024-02-10 16:40:51 +01:00
2024-02-10 14:50:42 +01:00
- name: Enable home directory creation for new users
2024-02-10 15:12:03 +01:00
command: pam-auth-update --enable mkhomedir
- name: TeXlive
apt:
name:
- texlive-luatex
- texlive-latex-recommended
- texlive-latex-extra
- texlive-extra-utils
- texlive-publishers
- texlive-lang-english
- texlive-lang-german
2024-02-10 16:40:51 +01:00
- texlive-pictures
- texstudio
- texstudio-l10n
2024-02-11 20:09:13 +01:00
- name: ensures /etc/firefox/policies dir exists
file:
path: "/etc/firefox/policies"
state: directory
2024-02-11 17:14:21 +01:00
- name: Add Firefox bookmarks
copy:
src: firefox-policies.json
dest: /etc/firefox/policies/policies.json
2024-02-10 16:40:51 +01:00
- name: Add noble-proposed
2024-02-10 16:40:51 +01:00
apt_repository:
repo: deb http://de.archive.ubuntu.com/ubuntu noble-proposed universe
2024-02-10 16:40:51 +01:00
state: present
filename: noble-proposed
2024-02-10 16:40:51 +01:00
- name: Avoid normal upgrades from noble-proposed
2024-02-10 16:40:51 +01:00
copy:
dest: "/etc/apt/preferences.d/proposed-updates"
content: |
# Configure apt to allow selective installs of packages from proposed
Package: *
Pin: release a=noble-proposed
2024-02-10 16:40:51 +01:00
Pin-Priority: 400
- name: Install Bacula File Daemon
apt:
name: bacula-fd
2024-02-10 17:08:08 +01:00
- name: Install script for bacula-fd configuration
copy:
src: bacula-conf.py
dest: /usr/local/bin/bacula-conf.py
mode: 0700
2024-02-12 14:40:40 +01:00
#- name: run configuration for bacula-fd
# command: /usr/local/bin/bacula-conf.py
#- name: Restart service bacula-fd
# service:
# name: bacula-fd
# state: restarted
2024-02-11 14:17:50 +01:00
2024-02-11 16:20:10 +01:00
- name: Install MATLAB dependencies
2024-02-11 14:17:50 +01:00
# source: https://github.com/mathworks-ref-arch/container-images/blob/main/matlab-deps/r2023b/ubuntu22.04/base-dependencies.txt
apt:
name:
- ca-certificates
2024-12-02 17:18:22 +01:00
- libasound2t64
2024-02-11 14:17:50 +01:00
- libc6
- libcairo-gobject2
- libcairo2
- libcap2
- libcups2
- libdrm2
- libgbm1
- libgdk-pixbuf-2.0-0
- libgl1
- libglib2.0-0
- libgstreamer-plugins-base1.0-0
- libgstreamer1.0-0
- libgtk-3-0
- libice6
- libltdl7
- libnspr4
- libnss3
- libpam0g
- libpango-1.0-0
- libpangocairo-1.0-0
- libpangoft2-1.0-0
- libsndfile1
- libuuid1
- libwayland-client0
- libxcomposite1
- libxcursor1
- libxdamage1
- libxfixes3
- libxft2
- libxinerama1
- libxrandr2
- libxt6
- libxtst6
- libxxf86vm1
- locales
- locales-all
- make
- net-tools
- procps
- sudo
- unzip
- zlib1g
- name: Install MATLAB license file
copy:
dest: /etc/matlab_license.dat
content: |
SERVER lic64-1.hrz.tu-darmstadt.de 005056bf0915 1718
SERVER lic64-2.hrz.tu-darmstadt.de 000102f14cdc 1718
SERVER lic64-3.hrz.tu-darmstadt.de 0060b0328d82 1718
USE_SERVER
- name: Mount MATLAB install media
command: mount -o ro 192.168.0.129:/srv/saltmine/matlab2023b /mnt
- name: MATLAB installation
command: /mnt/install -inputFile /mnt/installer_input.txt
- name: unmount MATLAB install media
command: umount /mnt
2024-02-11 16:17:56 +01:00
- name: Define MATLAB path
2024-02-11 16:40:54 +01:00
copy:
dest: "/etc/profile.d/matlab.sh"
content: |
2024-02-11 16:43:11 +01:00
PATH=$PATH:"/opt/matlab/R2023b/bin"
2024-02-11 16:17:56 +01:00
- name: Add MATLAB desktop entry
copy:
dest: /usr/share/applications/matlab.desktop
content: |
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/opt/matlab/R2023b/bin/matlab -desktop
Name=MATLAB
Icon=/opt/matlab/R2023b/bin/glnxa64/cef_resources/matlab_icon.png
Categories=Development;Math;Science
Comment=Scientific computing environment
Comment[zh_CN] = 科学计算环境
StartupNotify=true
StartupWMClass=com-mathworks-util-PostVMInit
2024-02-11 20:09:13 +01:00
- name: ensures "/etc/dconf/db/ipkm.d" dir exists
file:
path: "/etc/dconf/db/ipkm.d"
state: directory
2024-02-11 17:53:59 +01:00
- name: Copy default dock configuration (1)
copy:
src: dconf/db/ipkm.d/00-ipkm-settings
dest: /etc/dconf/db/ipkm.d/00-ipkm-settings
- name: Copy default dock configuration (2)
copy:
src: dconf/profile/user
dest: /etc/dconf/profile/user
- name: Update default dock confuguration
command: dconf update
2024-02-12 13:34:25 +01:00
2024-02-12 17:10:16 +01:00
- name: Search for inventory in file
2024-02-12 15:13:36 +01:00
command:
cmd: grep -oP inventory_number=\\K\\d+ /etc/inventory_number.cmdline
register: result
# Since it is a reporting task
# which needs to deliver a result in any case
failed_when: result.rc != 0 and result.rc != 1
check_mode: false
changed_when: false
- name: Show result, if any
copy:
dest: /etc/inventory_number
content: |
{{ result.stdout_lines[0] }}
when: result.rc == 0
2024-02-12 17:10:16 +01:00
- name: Search for hostname in file
command:
cmd: grep -oP inventory_number=\\K\\w+ /etc/inventory_number.cmdline
register: result_hostname
# Since it is a reporting task
# which needs to deliver a result in any case
failed_when: result_hostname.rc != 0 and result_hostname.rc != 1
check_mode: false
changed_when: false
- name: Set hostname
command: hostnamectl set-hostname {{ result_hostname.stdout_lines[0] }}
when: result_hostname.rc == 0
2024-12-02 17:31:02 +01:00
- name: disable systemd-networkd
command: systemctl disable systemd-networkd.service systemd-networkd.socket
2024-02-12 17:10:16 +01:00
2024-02-12 15:01:01 +01:00
- name: Enable login screen after install
command: systemctl start systemd-logind.service