From 5e6ac2c2953e3aeca7448a44e50ad8e1d4064a95 Mon Sep 17 00:00:00 2001 From: oscarpocock Date: Sun, 22 May 2022 23:48:10 +0100 Subject: [PATCH] Added creating config directories --- .../base/files/users/noble/bash/bash_aliases | 1 + roles/base/files/users/noble/bash/bashrc | 12 ++++++++++ roles/base/tasks/users/noble.yml | 24 ++++++++++++++++++- vars/vault.yml | 10 ++++---- 4 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 roles/base/files/users/noble/bash/bash_aliases create mode 100644 roles/base/files/users/noble/bash/bashrc diff --git a/roles/base/files/users/noble/bash/bash_aliases b/roles/base/files/users/noble/bash/bash_aliases new file mode 100644 index 0000000..2790c47 --- /dev/null +++ b/roles/base/files/users/noble/bash/bash_aliases @@ -0,0 +1 @@ +alias update="sudo pacman -Sy" \ No newline at end of file diff --git a/roles/base/files/users/noble/bash/bashrc b/roles/base/files/users/noble/bash/bashrc new file mode 100644 index 0000000..c9c8a56 --- /dev/null +++ b/roles/base/files/users/noble/bash/bashrc @@ -0,0 +1,12 @@ +# Source bash aliases +source ~/.bash/bash_aliases + +# +# ~/.bashrc +# + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +alias ls='ls --color=auto' +PS1='[\u@\h \W]\$ ' \ No newline at end of file diff --git a/roles/base/tasks/users/noble.yml b/roles/base/tasks/users/noble.yml index 1022a8a..5e92dd8 100644 --- a/roles/base/tasks/users/noble.yml +++ b/roles/base/tasks/users/noble.yml @@ -11,4 +11,26 @@ state: present comment: "Oscar Pocock" password: "{{ noble_passwd }}" - shell: /bin/bash \ No newline at end of file + shell: /bin/bash + +- name: users | noble | create config directories + file: + path: /home/noble/{{ item.dir }} + state: directory + owner: noble + group: noble + mode: 0700 + with_items: + - { dir: '.bash' } + - { dir: '.config' } + +- name: users | noble | copy dotfiles + copy: + src: users/noble/{{ item.src }} + dest: /home/noble/{{ item.dest }} + owner: noble + group: noble + mode: 0600 + with_items: + - { src: 'bash/bash_aliases', dest: '.bash/bash_aliases' } + - { src: 'bash/bashrc', dest: '.bashrc' } \ No newline at end of file diff --git a/vars/vault.yml b/vars/vault.yml index 2184728..0a78031 100644 --- a/vars/vault.yml +++ b/vars/vault.yml @@ -1,6 +1,6 @@ $ANSIBLE_VAULT;1.1;AES256 -30626639643564373063616266616466383464633734613237336438616163316339316334316566 -3935373463303134623862663535383034623165303861320a336138643563623535386261383632 -64393030613239353565363462353965373038666365616539363733663964636431353765373532 -6665346335393363640a363238623263336163323765633962353133633161326134633830333330 -30633839326436646536396235623839323936373464663862326465663237373436 +37343335643432363139336430333561373232633562613365626163383361623661366131646638 +3931656337623061303037633335303066336662613938660a343866333031313864346232396534 +31373765326137636633366331393238373865333262653565306561336433396137616630616336 +6436636534323763370a323962336337306262336363653039323564313139633834663431646562 +37346239306137353465396334646338343634363162663161396264313766333739