-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #712 from Zarquan/20220517-zrq-user-accounts
20220517-zrq-user-accounts - all the changes in one big commit
- Loading branch information
Showing
42 changed files
with
9,234 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
# | ||
# <meta:header> | ||
# <meta:licence> | ||
# Copyright (c) 2022, ROE (http://www.roe.ac.uk/) | ||
# | ||
# This information is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This information is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# </meta:licence> | ||
# </meta:header> | ||
# | ||
|
||
echo "---- ----" | ||
echo "date [$(date)]" | ||
echo "host [$(hostname)]" | ||
echo "PATH [${PATH}]" | ||
echo "---- ----" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/sh | ||
# | ||
# <meta:header> | ||
# <meta:licence> | ||
# Copyright (c) 2022, ROE (http://www.roe.ac.uk/) | ||
# | ||
# This information is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This information is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# </meta:licence> | ||
# </meta:header> | ||
# | ||
# | ||
|
||
# ----------------------------------------------------- | ||
# Settings ... | ||
|
||
# set -eu | ||
# set -o pipefail | ||
# | ||
# binfile="$(basename ${0})" | ||
# binpath="$(dirname $(readlink -f ${0}))" | ||
# treetop="$(dirname $(dirname ${binpath}))" | ||
# | ||
# echo "" | ||
# echo "---- ---- ----" | ||
# echo "File [${binfile}]" | ||
# echo "Path [${binpath}]" | ||
# echo "Tree [${treetop}]" | ||
# echo "---- ---- ----" | ||
# | ||
|
||
|
||
# get the next available uid | ||
# https://www.commandlinefu.com/commands/view/5684/determine-next-available-uid | ||
getnextuid() | ||
{ | ||
getent passwd | awk -F: '($3>600) && ($3<60000) && ($3>maxuid) { maxuid=$3; } END { print maxuid+1; }' | ||
} | ||
|
||
|
||
# Generate a new password hash. | ||
newpasshash() | ||
{ | ||
local password="${1:?}" | ||
java \ | ||
-jar "${HOME}/lib/shiro-tools-hasher.jar" \ | ||
-i 500000 \ | ||
-f shiro1 \ | ||
-a SHA-256 \ | ||
-gss 128 \ | ||
'${password:?}' | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# | ||
# <meta:header> | ||
# <meta:licence> | ||
# Copyright (c) 2022, ROE (http://www.roe.ac.uk/) | ||
# | ||
# This information is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This information is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# </meta:licence> | ||
# </meta:header> | ||
# | ||
# | ||
|
||
test-users: | ||
|
||
- name: "Nelia" | ||
uuid: "5cf0cf95-157e-4a40-b95e-b163f22c2d92" | ||
uid: 2050 | ||
gid: 2050 | ||
home: "/home/Nelia" | ||
data: | ||
path: "/user/Nelia" | ||
size: "20" | ||
|
||
- name: "Ghoria" | ||
uuid: "237983b5-a21f-47c8-8fb3-80cbbc70ba56" | ||
uid: 2051 | ||
home: "/home/Ghoria" | ||
data: | ||
path: "/user/Ghoria" | ||
|
||
- name: "Nalla" | ||
uuid: "65c7aeb1-3c2a-43b7-acc0-8c4497997c70" | ||
uid: 2052 | ||
home: "/home/Nalla" | ||
|
||
- name: "Wenia" | ||
uid: 2053 | ||
|
||
- name: "Ava" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# | ||
# <meta:header> | ||
# <meta:licence> | ||
# Copyright (c) 2022, ROE (http://www.roe.ac.uk/) | ||
# | ||
# This information is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This information is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# </meta:licence> | ||
# </meta:header> | ||
# | ||
# | ||
|
||
|
||
--- | ||
- name: "Install Aglais tools" | ||
hosts: zeppelin | ||
gather_facts: false | ||
vars_files: | ||
- config/aglais.yml | ||
- config/ansible.yml | ||
- config/zeppelin.yml | ||
- /tmp/ansible-vars.yml | ||
tasks: | ||
|
||
- name: "Create Aglais directory [{{aghome}}]" | ||
become: true | ||
ansible.builtin.file: | ||
path: '{{aghome}}' | ||
owner: 'root' | ||
group: 'root' | ||
state: directory | ||
mode: 'u=rwx,g=rwx,o=rx' | ||
|
||
- name: "Create Aglais bin directory [{{aghome}}/bin]" | ||
become: true | ||
ansible.builtin.file: | ||
path: '{{aghome}}/bin' | ||
owner: 'root' | ||
group: 'root' | ||
state: directory | ||
mode: 'u=rwx,g=rwx,o=rx' | ||
|
||
- name: "Create Aglais lib directory [{{aghome}}/lib]" | ||
become: true | ||
ansible.builtin.file: | ||
path: '{{aghome}}/lib' | ||
owner: 'root' | ||
group: 'root' | ||
state: directory | ||
mode: 'u=rwx,g=rwx,o=rx' | ||
|
||
- name: "Create Aglais tmp directory [{{aghome}}/tmp]" | ||
become: true | ||
ansible.builtin.file: | ||
path: '{{aghome}}/tmp' | ||
owner: "{{zepuser}}" | ||
group: "{{zepuser}}" | ||
state: directory | ||
mode: 'u=rwx,g=rwx,o=rx' | ||
|
||
- name: "Copy Aglais tools to [{{aghome}}/bin]" | ||
become: true | ||
ansible.builtin.copy: | ||
src: '{{playbook_dir | dirname | dirname }}/aglais/bin/' | ||
dest: '{{aghome}}/bin' | ||
owner: 'root' | ||
group: 'root' | ||
mode: 'u=rwx,g=rwx,o=rx' | ||
|
||
- name: "Create [/etc/profile.d/aglais.sh]" | ||
become: true | ||
ansible.builtin.blockinfile: | ||
dest: '/etc/profile.d/aglais.sh' | ||
state: present | ||
owner: 'root' | ||
group: 'root' | ||
mode: 'u=rw,g=r,o=r' | ||
create: true | ||
insertafter: 'EOF' | ||
marker: '# {mark} Ansible managed configuration' | ||
block: | | ||
export PATH=${PATH}:{{aghome}}/bin | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.