From 993461fe4976821deba07ecc1b924fb0299ae560 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 12 Feb 2021 07:47:22 -0600 Subject: [PATCH] Add bin folder for users. Some of this probably needs to become looped. --- local.yml | 4 ++-- tasks/general/acct_mgmt/users.yml | 27 +++++++++++++++++++++------ tasks/general/scripts/root.yml | 4 ++-- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/local.yml b/local.yml index d8fd476..38b454b 100644 --- a/local.yml +++ b/local.yml @@ -22,14 +22,14 @@ - include: facts/general/gather.yml - - include: tasks/general/scripts/root.yml - - include: tasks/general/acct_mgmt/groups.yml - include: tasks/general/acct_mgmt/users.yml - include: tasks/general/acct_mgmt/sudo.yml - include: tasks/general/acct_mgmt/keys.yml - include: tasks/general/acct_mgmt/mounts.yml + - include: tasks/general/scripts/root.yml + - include: tasks/general/cron/ansible.yml - include: tasks/freebsd/cron/ansible.yml diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 7db8ca7..27ae856 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -22,6 +22,14 @@ generate_ssh_key: yes register: user_ling +- name: General | Account Management | User | Hyperling | bin Folder + file: + path: "{{ user_ling.home }}/bin" + state: directory + mode: '0755' + become_user: ling + when: user_ling.home != "" + - name: General | Account Management | User | Hyperling | TRASH Folder file: path: "{{ user_ling.home }}/TRASH" @@ -56,26 +64,33 @@ shell: "{{ bash_exec.stdout }}" create_home: yes generate_ssh_key: yes - register: root + register: user_root + +- name: General | Account Management | User | Root | bin Folder + file: + path: "{{ user_root.home }}/bin" + state: directory + mode: '0755' + when: user_root.home != "" - name: General | Account Management | User | Root | TRASH Folder file: - path: "{{ root.home }}/TRASH" + path: "{{ user_root.home }}/TRASH" state: directory mode: '0755' - when: root.home != "" + when: user_root.home != "" - name: General | Account Management | User | Root | .bashrc Entries blockinfile: - path: "{{ root.home }}/.bashrc" + path: "{{ user_root.home }}/.bashrc" block: | alias cp='cp -v' alias mv='mv -v' alias rm='echo "Use mv ~/TRASH/ instead!"' - export PATH=".:~/bin:$PATH" + export PATH="~/bin:$PATH" marker: '# {mark} MANAGED BY ANSIBLE | Aliases' state: present create: yes backup: yes ignore_errors: yes - when: root.home != "" \ No newline at end of file + when: user_root.home != "" \ No newline at end of file diff --git a/tasks/general/scripts/root.yml b/tasks/general/scripts/root.yml index 4da2a48..538504c 100644 --- a/tasks/general/scripts/root.yml +++ b/tasks/general/scripts/root.yml @@ -3,7 +3,7 @@ - name: General | Scripts | Root | scm.sh blockinfile: - path: /root/scm.sh + path: "{{ user_root.home }}/scm.sh" block: | # 20210211 - Make life easier! ssh ling@leet "cd Code/Ansible/ansible-pull; git push" @@ -17,5 +17,5 @@ - name: General | Scripts | Root | scm.sh Permissions file: - path: /root/scm.sh + path: "{{ user_root.home }}/scm.sh" mode: '0755' \ No newline at end of file