added user variables

pull/1/head
Cian Hatton 3 years ago
parent e493b4812f
commit 26b96ecd29

@ -1,5 +1,7 @@
---
- hosts: servers
vars_files:
- ../variables.yml
become: true
tasks:
- name: Checkout Git Repos

@ -14,6 +14,8 @@
---
- name: Redeploy Portainer and All Volumes
hosts: servers
vars_files:
- ../variables.yml
tasks:
- name: Restore Tautulli
import_tasks: ../tasks/restore-volume-tasks.yml

@ -1,6 +1,8 @@
---
- hosts: servers
become: true
vars_files:
- ../variables.yml
tasks:
- name: Update and upgrade apt packages
apt:

@ -2,6 +2,8 @@
# ansible-playbook -v ansible/playbooks/volume-restore.yml -e "container_name=mariadb"
---
- hosts: servers
vars_files:
- ../variables.yml
tasks:
- name: Restore Volume
import_tasks: ../tasks/restore-volume-tasks.yml

@ -2,12 +2,12 @@
- name: Git checkout HomeLab repository
ansible.builtin.git:
repo: 'https://github.com/chatton/HomeLab.git'
dest: /home/cianhatton/checkouts/HomeLab
dest: "/home/{{homelab_user}}/checkouts/HomeLab"
force: true
version: master
- name: Change Ownership
file:
path: /home/cianhatton/checkouts/HomeLab
owner: cianhatton
group: cianhatton
path: "/home/{{homelab_user}}/checkouts/HomeLab"
owner: "{{homelab_user}}"
group: "{{homelab_group}}"

@ -7,21 +7,21 @@
state: latest
update_cache: true
- name: Make sure we have a 'cianhatton' group
- name: Make sure we have a '{{homelab_group}}' group
group:
name: cianhatton
name: "{{homelab_group}}"
state: present
- name: Allow 'cianhatton' group to have passwordless sudo
- name: Allow '{{homelab_user}}' group to have passwordless sudo
lineinfile:
dest: /etc/sudoers
state: present
regexp: '^%cianhatton'
line: '%cianhatton ALL=(ALL) NOPASSWD: ALL'
regexp: '^%{{homelab_user}}'
line: '%{{homelab_user}} ALL=(ALL) NOPASSWD: ALL'
validate: 'visudo -cf %s'
- name: Add User
ansible.builtin.user:
name: cianhatton
comment: Cian Hatton
name: "{{homelab_user}}"
comment: "{{homelab_user}} user"
uid: 1000
group: cianhatton
group: "{{homelab_group}}"

@ -0,0 +1,4 @@
---
homelab_user: cianhatton
homelab_group: cianhatton
backup_dir: /mnt/hdds/backups/
Loading…
Cancel
Save