Rename files

This commit is contained in:
rockstable 2022-12-10 19:55:33 +01:00
parent d17f4f92a7
commit 89c992b78b
8 changed files with 153 additions and 79 deletions

View File

@ -1,22 +1,19 @@
---
galaxy_info:
author: Alexander Böhm
description: FAI server for Hardware For Future
company: Hardware For Future
# issue_tracker_url: http://example.com/issue/tracker
license: MIT
min_ansible_version: 2.9
platforms:
- name: Debian
versions:
- 10
- name: Debian
versions:
- 10
- 11
- 12
galaxy_tags:
- hw4f
collections:
- ansible.posix

View File

@ -8,19 +8,6 @@
group: root
mode: '0755'
- name: "Copy fai profiles to '{{ fai_dir_config }}'"
become: true
ansible.builtin.copy:
src: "profiles/"
dest: "{{ fai_dir_config }}"
owner: root
group: root
mode: '0755'
force: true
#recursive: true
notify: pack fai-config
when: false
- name: "Git checkout fai-config to '{{ fai_dir_config }}'"
become: true
ansible.builtin.git:
@ -40,6 +27,90 @@
mode: '0755'
#recursive: true
- name: "Set APT proxy"
become: true
ansible.builtin.template:
src: "etc/apt/apt.conf.d/02proxy.j2"
dest: "{{ fai_dir_config }}/files/etc/apt/apt.conf.d/02proxy/HW4F_DESKTOP"
owner: root
group: root
mode: '0644'
notify: pack fai-config
when: false
- name: "Set default menu entry to profile"
become: true
ansible.builtin.copy:
content: |
Default: {{ fai_menu_default }}
dest: "{{ fai_dir_config + '/class/zz_menu_default.profile' }}"
owner: root
group: root
mode: '0644'
when:
- fai_menu_default is defined
- fai_menu_default is not none
- name: "Create class specific directories"
become: true
vars:
paths:
- "scripts/HW4F_DESKTOP"
- "scripts/HW4F_DESKTOP_LAST"
ansible.builtin.file:
dest: "{{ fai_dir_config + '/' + item }}"
state: directory
owner: root
group: root
mode: '0755'
loop: "{{ paths }}"
notify: pack fai-config
- name: "Define files in '{{ fai_dir_config }}'"
become: true
vars:
scripts:
- src: "class/HW4F_DESKTOP.var.j2"
dest: "class/HW4F_DESKTOP.var"
mode: '0644'
- src: "scripts/00-remove-proxy.j2"
dest: "scripts/HW4F_DESKTOP_LAST/00-remove-proxy"
mode: "0755"
ansible.builtin.template:
src: "srv/fai/config/{{ item.src }}"
dest: "{{ fai_dir_config + '/' + item.dest }}"
owner: root
group: root
mode: "{{ item.mode }}"
notify: pack fai-config
loop: "{{ scripts }}"
- name: "Define files in '{{ fai_dir_config }}' without templating"
become: true
vars:
scripts:
- src: "scripts/04-snaps"
dest: "scripts/HW4F_DESKTOP/04-snaps"
mode: '0755'
### TRICK COPY TO FIND THE "FILE"
### IN THE DIRECTORY "templates" NOT IN "files"
search_prefix: "templates/"
- src: "scripts/91-misc"
dest: "scripts/HW4F_DESKTOP/91-misc"
mode: '0755'
### TRICK COPY TO FIND THE "FILE"
### IN THE DIRECTORY "templates" NOT IN "files"
search_prefix: "templates/"
ansible.builtin.copy:
src: "{{ item.search_prefix | default('') +
'srv/fai/config/' + item.src }}"
dest: "{{ fai_dir_config + '/' + item.dest }}"
owner: root
group: root
mode: "{{ item.mode }}"
notify: pack fai-config
loop: "{{ scripts }}"
- name: "Define FAI classes for BASEFILES"
become: true
ansible.builtin.template:
@ -55,37 +126,3 @@
- basefile: "FOCAL64"
dist: "focal"
mirror_url: "{{ ubuntu_mirror_url }}"
- name: "Set APT proxy"
become: true
ansible.builtin.template:
src: "etc/apt/apt.conf.d/02proxy.j2"
dest: "{{ fai_dir_config }}/files/etc/apt/apt.conf.d/02proxy/HW4F_DESKTOP"
owner: root
group: root
mode: '0644'
notify: pack fai-config
when: false
- name: "Define fai CLASS 'HW4F_DESKTOP'"
become: true
ansible.builtin.template:
src: "srv/fai/config/class/HW4F_DESKTOP.var"
dest: "{{ fai_dir_config }}/class/HW4F_DESKTOP.var"
owner: root
group: root
mode: '0644'
notify: pack fai-config
- name: "Set default menu entry to profile"
become: true
ansible.builtin.copy:
content: |
Default: {{ fai_menu_default }}
dest: "{{ fai_dir_config + '/class/zz_menu_default.profile' }}"
owner: root
group: root
mode: '0644'
when:
- fai_menu_default is defined
- fai_menu_default is not none

View File

@ -1,23 +0,0 @@
### CONFIGURE TIME
UTC=yes
TIMEZONE=Europe/Berlin
### INSTALL PARAMETERS
STOP_ON_ERROR=700
MAXPACKAGES=800
HOSTNAME="user-pc"
KEYMAP=de-latin1-nodeadkeys
ROOTPW='{{ fai_hw4f_profile_password |password_hash("sha512") }}'
# START USER AND PASSWORD
username={{ fai_hw4f_profile_username }}
USERPW='{{ fai_hw4f_profile_password |password_hash("sha512") }}'
SUPRESS_GNOME_INITIAL_SCREEN=1
FAI_ALLOW_UNSIGNED=0
APTPROXY=http://{{ server_name }}:3142

View File

@ -0,0 +1,36 @@
### CONFIGURE TIME
UTC=yes
TIMEZONE=Europe/Berlin
### INSTALL PARAMETERS
STOP_ON_ERROR=700
MAXPACKAGES=800
HOSTNAME="user-pc"
KEYMAP=de-latin1-nodeadkeys
ROOTPW='{{ fai_hw4f_profile_password
| password_hash("sha512", fai_hw4f_password_salt ) }}'
# START USER AND PASSWORD
username={{ fai_hw4f_profile_username }}
USERPW='{{ fai_hw4f_profile_password
| password_hash("sha512", fai_hw4f_password_salt ) }}'
SUPRESS_GNOME_INITIAL_SCREEN=1
FAI_ALLOW_UNSIGNED=0
APTPROXY=http://{{ server_name }}:3142
### CONFIGURE LOG UPLOAD
{% if fai_loguser is defined and
fai_loguser is none %}
### DISABLE LOG UPLOAD
LOGUSER=
{% elif fai_loguser is defined and
fai_loguser is not none %}
LOGUSER={{ fai_loguser }}
{% else %}
#LOGUSER=
{% endif %}

View File

@ -0,0 +1,5 @@
#!/bin/bash
[ -f $target/etc/apt/apt.conf.d/02proxy ] && \
rm $target/etc/apt/apt.conf.d/02proxy

View File

@ -0,0 +1,15 @@
#!/bin/bash
if [ "${#SNAPS[*]}" -eq 0 ]; then
SNAPS=( firefox )
fi
function package_exists() {
return dpkg -l "$1" &> /dev/null
}
for SNAP in $SNAPS; do
if ! package_exists "snapd"; then
snap install "$SNAP"
fi
done

View File

@ -0,0 +1,7 @@
#! /bin/bash
# disable the first login screen
$ROOTCMD dpkg-divert --local --rename --add /etc/xdg/autostart/gnome-initial-setup-first-login.desktop
$ROOTCMD dpkg-divert --local --rename --add /etc/xdg/autostart/gnome-initial-setup-copy-worker.desktop
$ROOTCMD deluser --system gnome-initial-setup
$ROOTCMD dpkg-reconfigure keyboard-configuration