Commit ad7de9a6 authored by Todor Kondic's avatar Todor Kondic
Browse files

bootstrap.yml: New playbook to run once.

parent 309950b3
# This needs to be thought through better. Obviously, we need root
# acces for this to work, ie ask pass allowed for the time bootstrap
# tasks are taking place. A temporary window from a fixed location
# makes sense.
- hosts: bootstrap
remote_user: adamsmith
become: True
become_method: sudo
vars:
sshkeys: meta/sshkeys
tasks:
- name: Install sudo.
apt:
name: [ 'sudo' ]
- name: Create default sudo user.
user:
name: adamsmith
generate_ssh_keys: yes
shell: /bin/bash
groups: adm, cdrom, dip, plugdev, sudo
- name: Add ssh keys for this user.
authorized_keys:
user: adamsmith
state: present
with_fileglob: meta/sshkeys/*
- hosts: stations
become: True
become_method: sudo
become_user: adamsmith
vars_files:
- vars/users.yml
- vars/passwords.yml
pre_tasks:
- name: Update repositories
apt: update_cache=yes
changed_when: False
tasks:
# - name: Set hostname.
# ansible.builtin.hostname:
# name: "{{ inventory_hostname }}"
# tags: hostname
- include: tasks/users.yml
tags: users
- name: Copy profiles.
tags: profile
copy:
src: files/home/user/.profile
dest: "/home/{{ item.login }}/.profile"
become_user: "{{ item.login }}"
loop: "{{ users }}"
# - include: tasks/apt.yml
# tags: apt
# # Set lightdm as login manager and make it listen to incoming
# # connections.
# - include: tasks/lightdm.yml
# tags: lightdm
# - include: tasks/guix.yml
# tags: guix
# - include: tasks/keyboard.yml
# tags: emacs
# - include: tasks/r-setup.yml
# tags: r-setup
# # - include: tasks/metfrag.yml
# # tags: metfrag
# handlers:
# - name: restart-lightdm
# command: systemctl restart lightdm
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