You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

78 lines
1.9 KiB

- hosts: all
tasks:
- name: Create user
user:
name: user
shell: /bin/bash
update_password: on_create
password: '$6$MAXqjGC7haX82aPF$rAM/zU6upb0cfIS7PKVWT27i3C.YbidlctAoGI43mKaQVz8bVr00MusJ/9k0SWRyf4W9i6A5xmhgRMR64kFrn.'
- name: Create ansible user
user:
name: ansible
shell: /bin/bash
groups: sudo
- name: Add authorized key for ansible user
authorized_key:
user: ansible
state: present
key: "{{ lookup('file', '/home/user/.ssh/id_rsa.pub') }}"
- name: NOPASSWD sudo option for ansible user
copy:
src: /home/user/docs/ansible/files/sudoers
dest: /etc/sudoers
- name: Setting repos
copy:
src: /home/user/docs/ansible/files/sources.list
dest: /etc/apt/sources.list
- name: Setting apt preferences
copy:
src: /home/user/docs/ansible/files/preferences
dest: /etc/apt/preferences
- name: Update packages
apt:
name: "*"
state: latest
update_cache: yes
cache_valid_time: 3600
- name: Install packages
apt:
pkg:
- xfce4
- xfce4-terminal
- network-manager-gnome
- bash-completion
- name: Enable autologin
copy:
src: /home/user/docs/ansible/files/lightdm.conf
dest: /etc/lightdm/lightdm.conf
- name: Create .config directory
file:
path: /home/user/.config
state: directory
owner: user
group: user
mode: '700'
- name: Create autostart directory
file:
path: /home/user/.config/autostart
state: directory
owner: user
group: user
mode: '700'
- name: Disable screensaver
copy:
src: /home/user/docs/ansible/files/light-locker.desktop
dest: /home/user/.config/autostart/light-locker.desktop
owner: user
group: user