From a218815c590362ff4e4608dc0b27a09234e42c9e Mon Sep 17 00:00:00 2001 From: oscarpocock Date: Sun, 22 May 2022 23:19:53 +0100 Subject: [PATCH] Added user role --- ansible.cfg | 4 ++++ local.yml | 11 +++++------ roles/base/tasks/users/noble.yml | 14 ++++++++++++++ vars/vault.yml | 6 ++++++ 4 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 ansible.cfg create mode 100644 roles/base/tasks/users/noble.yml create mode 100644 vars/vault.yml diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..58dd990 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,4 @@ +[defaults] +inventory = hosts +log_path = /var/log/ansible.log +retry_files_enabled = False \ No newline at end of file diff --git a/local.yml b/local.yml index 317b2db..f60efae 100644 --- a/local.yml +++ b/local.yml @@ -1,7 +1,6 @@ -- hosts: localhost +- hosts: all + vars_files: + - 'vars/vault.yml' become: true - tasks: - - name: Install htop - community.general.pacman: - name: htop - state: present + roles: + - base \ No newline at end of file diff --git a/roles/base/tasks/users/noble.yml b/roles/base/tasks/users/noble.yml new file mode 100644 index 0000000..1022a8a --- /dev/null +++ b/roles/base/tasks/users/noble.yml @@ -0,0 +1,14 @@ +- name: users | noble | create group + group: + name: noble + state: present + +- name: users | noble | create user + user: + name: noble + group: noble + groups: adm,ansible,wheel + state: present + comment: "Oscar Pocock" + password: "{{ noble_passwd }}" + shell: /bin/bash \ No newline at end of file diff --git a/vars/vault.yml b/vars/vault.yml new file mode 100644 index 0000000..2184728 --- /dev/null +++ b/vars/vault.yml @@ -0,0 +1,6 @@ +$ANSIBLE_VAULT;1.1;AES256 +30626639643564373063616266616466383464633734613237336438616163316339316334316566 +3935373463303134623862663535383034623165303861320a336138643563623535386261383632 +64393030613239353565363462353965373038666365616539363733663964636431353765373532 +6665346335393363640a363238623263336163323765633962353133633161326134633830333330 +30633839326436646536396235623839323936373464663862326465663237373436