some changes
This commit is contained in:
38
roles/addusers/README.md
Normal file
38
roles/addusers/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
Role Name
|
||||
=========
|
||||
|
||||
A brief description of the role goes here.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- { role: username.rolename, x: 42 }
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
BSD
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
||||
2
roles/addusers/defaults/main.yml
Normal file
2
roles/addusers/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for addusers
|
||||
2
roles/addusers/handlers/main.yml
Normal file
2
roles/addusers/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for addusers
|
||||
15
roles/addusers/meta/main.yml
Normal file
15
roles/addusers/meta/main.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
galaxy_info:
|
||||
author: Szymon Kolano
|
||||
description: https://github.com/skolano/
|
||||
company: PNT Data Center
|
||||
|
||||
|
||||
license: license (GPL-2.0-or-later, MIT, etc)
|
||||
|
||||
min_ansible_version: 2.1
|
||||
|
||||
|
||||
|
||||
galaxy_tags: []
|
||||
|
||||
dependencies: []
|
||||
36
roles/addusers/tasks/add_dglowacki.yml
Normal file
36
roles/addusers/tasks/add_dglowacki.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: Ensure group dcadmins exists
|
||||
ansible.builtin.group:
|
||||
name: dcadmins
|
||||
state: present
|
||||
|
||||
- name: Add User
|
||||
user:
|
||||
name: d.glowacki
|
||||
home: /home/d.glowacki/
|
||||
shell: /bin/bash
|
||||
comment: "Damian Głowacki"
|
||||
groups: dcadmins
|
||||
|
||||
- name: Allow wheel passwordless sudo
|
||||
lineinfile:
|
||||
dest: /etc/sudoers
|
||||
state: present
|
||||
line: '%dcadmins ALL=(ALL) NOPASSWD: ALL'
|
||||
validate: 'visudo -cf %s'
|
||||
|
||||
- name: Create .ssh directory
|
||||
file:
|
||||
path: /home/d.glowacki/.ssh
|
||||
state: directory
|
||||
mode: 0700
|
||||
owner: d.glowacki
|
||||
group: d.glowacki
|
||||
|
||||
- name: Deploy SSH-KEY.
|
||||
template:
|
||||
src: "d.glowacki/id_rsa.pub"
|
||||
dest: /home/d.glowacki/.ssh/authorized_keys
|
||||
mode: 0755
|
||||
owner: d.glowacki
|
||||
group: d.glowacki
|
||||
36
roles/addusers/tasks/add_kkobak.yml
Normal file
36
roles/addusers/tasks/add_kkobak.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: Ensure group dcadmins exists
|
||||
ansible.builtin.group:
|
||||
name: dcadmins
|
||||
state: present
|
||||
|
||||
- name: Add User
|
||||
user:
|
||||
name: k.kobak
|
||||
home: /home/k.kobak/
|
||||
shell: /bin/bash
|
||||
comment: "Kamil Kobak"
|
||||
groups: dcadmins
|
||||
|
||||
- name: Allow wheel passwordless sudo
|
||||
lineinfile:
|
||||
dest: /etc/sudoers
|
||||
state: present
|
||||
line: '%dcadmins ALL=(ALL) NOPASSWD: ALL'
|
||||
validate: 'visudo -cf %s'
|
||||
|
||||
- name: Create .ssh directory
|
||||
file:
|
||||
path: /home/k.kobak/.ssh
|
||||
state: directory
|
||||
mode: 0700
|
||||
owner: k.kobak
|
||||
group: k.kobak
|
||||
|
||||
- name: Deploy SSH-KEY.
|
||||
template:
|
||||
src: "k.kobak/id_rsa.pub"
|
||||
dest: /home/k.kobak/.ssh/authorized_keys
|
||||
mode: 0755
|
||||
owner: k.kobak
|
||||
group: k.kobak
|
||||
36
roles/addusers/tasks/add_mwach.yml
Normal file
36
roles/addusers/tasks/add_mwach.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: Ensure group dcadmins exists
|
||||
ansible.builtin.group:
|
||||
name: dcadmins
|
||||
state: present
|
||||
|
||||
- name: Add User
|
||||
user:
|
||||
name: m.wach
|
||||
home: /home/m.wach/
|
||||
shell: /bin/bash
|
||||
comment: "Marcin Wach"
|
||||
groups: dcadmins
|
||||
|
||||
- name: Allow wheel passwordless sudo
|
||||
lineinfile:
|
||||
dest: /etc/sudoers
|
||||
state: present
|
||||
line: '%dcadmins ALL=(ALL) NOPASSWD: ALL'
|
||||
validate: 'visudo -cf %s'
|
||||
|
||||
- name: Create .ssh directory
|
||||
file:
|
||||
path: /home/m.wach/.ssh
|
||||
state: directory
|
||||
mode: 0700
|
||||
owner: m.wach
|
||||
group: m.wach
|
||||
|
||||
- name: Deploy SSH-KEY.
|
||||
template:
|
||||
src: "m.wach/id_rsa.pub"
|
||||
dest: /home/m.wach/.ssh/authorized_keys
|
||||
mode: 0755
|
||||
owner: m.wach
|
||||
group: m.wach
|
||||
36
roles/addusers/tasks/add_praktykant.yml
Normal file
36
roles/addusers/tasks/add_praktykant.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: Ensure group dcadmins exists
|
||||
ansible.builtin.group:
|
||||
name: dcadmins
|
||||
state: present
|
||||
|
||||
- name: Add User
|
||||
user:
|
||||
name: praktykant
|
||||
home: /home/praktykant/
|
||||
shell: /bin/bash
|
||||
comment: "Praktykant"
|
||||
groups: dcadmins
|
||||
|
||||
- name: Allow wheel passwordless sudo
|
||||
lineinfile:
|
||||
dest: /etc/sudoers
|
||||
state: present
|
||||
line: '%dcadmins ALL=(ALL) NOPASSWD: ALL'
|
||||
validate: 'visudo -cf %s'
|
||||
|
||||
- name: Create .ssh directory
|
||||
file:
|
||||
path: /home/praktykant/.ssh
|
||||
state: directory
|
||||
mode: 0700
|
||||
owner: praktykant
|
||||
group: praktykant
|
||||
|
||||
- name: Deploy SSH-KEY.
|
||||
template:
|
||||
src: "praktykant/id_rsa.pub"
|
||||
dest: /home/praktykant/.ssh/authorized_keys
|
||||
mode: 0755
|
||||
owner: praktykant
|
||||
group: pratykant
|
||||
36
roles/addusers/tasks/add_skolano.yml
Normal file
36
roles/addusers/tasks/add_skolano.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: Ensure group dcadmins exists
|
||||
ansible.builtin.group:
|
||||
name: dcadmins
|
||||
state: present
|
||||
|
||||
- name: Add User
|
||||
user:
|
||||
name: s.kolano
|
||||
home: /home/s.kolano/
|
||||
shell: /bin/bash
|
||||
comment: "Szymon Kolano"
|
||||
groups: dcadmins
|
||||
|
||||
- name: Allow wheel passwordless sudo
|
||||
lineinfile:
|
||||
dest: /etc/sudoers
|
||||
state: present
|
||||
line: '%dcadmins ALL=(ALL) NOPASSWD: ALL'
|
||||
validate: 'visudo -cf %s'
|
||||
|
||||
- name: Create .ssh directory
|
||||
file:
|
||||
path: /home/s.kolano/.ssh
|
||||
state: directory
|
||||
mode: 0700
|
||||
owner: s.kolano
|
||||
group: s.kolano
|
||||
|
||||
- name: Deploy SSH-KEY.
|
||||
template:
|
||||
src: "s.kolano/id_rsa.pub"
|
||||
dest: /home/s.kolano/.ssh/authorized_keys
|
||||
mode: 0755
|
||||
owner: s.kolano
|
||||
group: s.kolano
|
||||
7
roles/addusers/tasks/main.yml
Normal file
7
roles/addusers/tasks/main.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
# tasks file for addusers
|
||||
- include_tasks: add_skolano.yml
|
||||
- include_tasks: add_kkobak.yml
|
||||
- include_tasks: add_dglowacki.yml
|
||||
- include_tasks: add_mwach.yml
|
||||
#- include_tasks: add_praktykant.yml
|
||||
1
roles/addusers/templates/d.glowacki/id_rsa.pub
Normal file
1
roles/addusers/templates/d.glowacki/id_rsa.pub
Normal file
@@ -0,0 +1 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDihgOogmAnrGtZmfakOvoLyI9J14u2gTU1dQuDYei8rQw4t2Qncc2hrYndRo05c+iqbIOfCnlZRXAnCd2rVfECi1DXvXOx9uMdxXHxQmEm+0h/JmWCNvkkWLDM44aoRQuEK2LXLhO9IHZbBHOz4rSihCJlfDIsVMMbooD0/Z0DZ00GpkJ+wzQMh6qkDXuv9ivcrTWsMhqqGmZekw2JRe/d80TWiZNg3tl33GWd4ImFrZ8mzO5RyM7gbzP1scQXo63QTnYyFKqaBZpB8rcpVThFLnAeFGeG4tPB8dceTXl45uXuhfCQhNveAwL/xxkcV1FNu4si2PjA490VwwsTrYrWTmVntpIXnXHte1F53oA3xfMgj1RpGLZakIdzUIPieSL/gf3wwTHGJH/YvBmQFrsVQkj9SnvNqCom3/V2TppshOOpMWPNOqOt6cZ92xHAVTkQD9H6rfTqRz/vhI2czm0uebFoU/szQsilwUE2jjpM+42EBm2ZgfriEXUq3nirc4k= damian@damian-glowacki-pnt
|
||||
1
roles/addusers/templates/k.kobak/id_rsa.pub
Normal file
1
roles/addusers/templates/k.kobak/id_rsa.pub
Normal file
@@ -0,0 +1 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC17NMAiErpbDxRG6VNKBXyPOh+fAMH5ZaPxVxMETAUvNfHPol05ytevl2YmOT69t2T5hHP79U1KALlVTqNyaSYdlLtG5ebbUigIW+i5w3gqLfiFkRNDZA6+r7w1otCPMGoWgiC5dJTJcROVwC9YCEyxdA0yPLJvN/htv1zYo6e+ZTZr8/WLShR3XSQqHoM1sjkIlBTbAotPiVz2IitQFlPwb0Ec0FMobXzb+XIN7iE2c7YvoeRtoMKjnfIhXnvbifU+PHN+deKTBqGg+Qc88scvu3uBKhmOeMm0gxTPdrCds83QvSdPZiObLlfc6LifcB3uZG4v46WVRvfr1NM/xYBUVZvsNCfuSgXxgdNAy7pl8RYi0fKs6cmiY7vgKStUJcYALOsEj6cQhSJNIQNjz8AZcKLCQX3GwLHJSYmeoCAixJKWvJh0Q6hw9EWuPKwLj1Ij8d50c9jfzyayZ2iDtJUysIV9/fwA9ZNW9TkrqZJZBDQKzZDEK4tj/paZTnxI7yJ5dJ04xfs2h+v9kvY7hVCu1OARVOXnSC/ImAdcJQnxj6gKRnaGyvDDturyyMaUH1pRlKhBIhWYNVq5gM7LB1him3vdRhJTj9/qWwwt8pNjQoFkPgtR2AZgl6YE7xNVoTgMq665gu2IQurcfiRqIVRotmDTg8tyaXtUow56rQ8iQ== kamil@CPD-Kamil
|
||||
1
roles/addusers/templates/m.wach/id_rsa.pub
Normal file
1
roles/addusers/templates/m.wach/id_rsa.pub
Normal file
@@ -0,0 +1 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDlWyL1Ub2zS9Z/ZZ6nlJsqKmxfO5l/MhryxcdZ+OOx7lRfo9CHzOcrqjiHljc36oe6ly6nFMyxHVl+4QZnIlyUbqfwQHd13eGWceryspOxqO0Vrv9mZ+cmeGY5rQQKe1MnxubByP9jMLFOmrVcWaq64ombln8O55oY53M+JRiTYIBYPtwIDRfQI3v7MhbjJdOjNBi3suhqAH26a2cDI6ErzhCVNbRLco6B6hBeXZtt/2Rh3mn+ns8w7WeOzy9k966hH3iHsTZW9FCaXjGHTAMuaERbQ8bisLiEPqEtPvBuu0OePXS+/R+gxZskN+slyuu1T6nc3XDOQFWCUqtxTjEV marcin_laptop
|
||||
1
roles/addusers/templates/praktykant/id_rsa.pub
Normal file
1
roles/addusers/templates/praktykant/id_rsa.pub
Normal file
@@ -0,0 +1 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOLRaCvRu8pLjKpKMedhomrKUwsFwGJUTxankPk63Yk3N+ZeUMd2W5b4utkKSDPo3XOhNaUf2+15Y6luN4PZJkIKGIMwIu++HpcFXgK5+2frAvCwfpzV60DMV3J+to4G53EvEr86dnvbpHXHLhvpYdwoTxzRp/Y38h/EtgdTXQnYUT6QKaNS+lV0VX1QWNwstuP1WwprRPBZT6qZoLJGDvk+AzobQFSnQvOVI15/gXQ/V+vlKA5KT6iv6/puoOFBdrq6kxBsX9BisdjqL1yuG+vqAGnwgvHVFMbbnAShJaV9H8U8KOMnz1VtyY3tUz9Ug6bZPQqEUZSqjINJfeySo9
|
||||
1
roles/addusers/templates/s.kolano/id_rsa.pub
Normal file
1
roles/addusers/templates/s.kolano/id_rsa.pub
Normal file
@@ -0,0 +1 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIneXJRhannHW+R4gpoU+sAJKa7YMER1+seOXe2jWxTXFVGwUYJntWQyGnRK7pYZA7UQbRznavMkpv99KvTry1WHpYmN5msHQi4Wnd/pzjY1jzU2BJCo0zhCu1rh4W6DBdzQCyj1PzwUoeoQCN8OcoofoALjOCk0HUM82zMCWqEsIXbk6VFFWqi5JfVuBFPO1+QPAwU8iYOaEtb+qnXQ6IePxWEsdpCxs8CjYKmQgwUAGl1RwnpuZXw0R5g3h6fIt5zSSVMvOSihwEZr2zyNmqaCUUaF5ML0bPYyJBpnDbmtNtZk1hGh512XOOwy9IZw+9COvpTguG2xuwv9VnvCMJ skolano@sko.dc.prod
|
||||
2
roles/addusers/tests/inventory
Normal file
2
roles/addusers/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/addusers/tests/test.yml
Normal file
5
roles/addusers/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- addusers
|
||||
2
roles/addusers/vars/main.yml
Normal file
2
roles/addusers/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for addusers
|
||||
@@ -1,2 +1 @@
|
||||
---
|
||||
sk_host: DC-L-2454
|
||||
3
vars/main.yml
Normal file
3
vars/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
sk_host: ansible
|
||||
sk_domain: local
|
||||
Reference in New Issue
Block a user