Commit 1b9e724c authored by Łukasz Nowak's avatar Łukasz Nowak

playbook: Introduce nexedi-laptop playbook

The general idea is to provide a machine connected to re6st, registered as
computer in SlapOS Master and with thorwable user to work on it.

Starting from default installation some uneeded packages are removed, and
few expected ones are added in order to have common set of packages and use
scenarios across all installations.
parent c52084b5
# Prepares computer as standard Nexedi laptop -- https://deploy.erp5.net/nexedi-laptop
# Optional
# * automatic monitoring
# * data on encrypted key
- name: Nexedi laptop configuration
hosts: 127.0.0.1
connection: local
vars:
partition_number: 10
vars_files:
- settings/gnet.yml
- settings/slapos-master.yml
vars_prompt:
- name: "computer_name"
prompt: "Name your computer (ignore if you already have a configured re6st and slapos or if you don't want to register your computer to SlapOS Master):"
private: no
default: "noname"
- name: "re6sttoken"
prompt: "\n\n
Please insert your token from Grandenet to configure your computer.\n
If you don't have a token, please access http://www.grandenet.cn/en \n
and request one. \n\n
Move informations at http://www.grandenet.cn/en/documentation/user
\n\n
Your token
"
private: no
default: "notoken"
pre_tasks:
- pause:
prompt: "Input your slapos token (ignore if you already have a configured slapos) [notoken]"
when: computer_name != "noname"
register: prompt
- set_fact:
slapostoken: "{{ prompt.user_input | default('notoken', true) }}"
- pause:
prompt: "Which network interface are you using? (ignore if you already have a configured re6st) [lo]"
when: slapostoken != "notoken"
register: prompt
- set_fact:
interface_name: "{{ prompt.user_input | default('lo', true) }}"
roles:
- { role: re6stnet-install }
- { role: re6stnet-ensure-running }
- { role: slapos, package_state: present }
- nexedi-laptop
#!/bin/sh
mv /home/nxdlap /home/nxdlap.`date '+%Y%m%d%H%M%S'`
mkdir -p /home/nxdlap
chown nxdlap:nxdlap /home/nxdlap
- name: Remove not needed packages
apt:
pkg:
- aisleriot
- firefox
- gedit
- gnome-mahjongg
- gnome-mines
- gnome-todo
- gnome-sudoku
- libreoffice-core
- rhythmbox
- thunderbird
- totem
- transmission-gtk
state: absent
autoremove: yes
when: ansible_distribution == "Ubuntu" and ansible_distribution_release == "focal"
- name: Install standard nexedi laptop packages
apt:
pkg:
- chromium-browser
- git
- ubuntu-desktop
- name: Add the user 'nxdlap'
user:
name: nxdlap
comment: nxdlap (Nexedi Laptop User)
groups: adm,cdrom,sudo,dip,plugdev,lpadmin,lxd,sambashare
password: '*'
update_password: on_create
- name: Create archive script
copy:
src: archive_nxdlap.sh
dest: /usr/local/bin/archive_nxdlap.sh
mode: 0700
- name: Remove (archive in reality) nxdlap contents on each reboot
cron:
name: "Remove (archive in reality) nxdlap contents on each reboot"
special_time: reboot
job: "/usr/local/bin/archive_nxdlap.sh"
cron_file: ansible-nxdlap-archive
user: root
- name: Explain
debug:
# XXX: Check password status of the account and then tell correctly
msg: On first run nxdlap user password is locked, please use 'passwd nxdlap' to set the password and activate the user, otherwise feel free to change the password if needed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment