added user variables

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

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

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

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

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

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

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