README.md 1.02 KB
Newer Older
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
1
Worker
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
2
3
=========

Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
4
5
6
Creates a system account and adds a private key if applies.
Is used for setting up access by deploy keys for servers using git repos, and to set up a non-root user to add cron-jobs to.

Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
7
8
9
* Creates a system user with a name (and a home folder)
* (Optional) Adds a private key for user.
* Adds known hosts (uib git server) to known hosts.
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
10

Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
11
12
Role is repeatable to add multiple system users.

Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
13
14
15
16
17
18
19
Requirements
------------


Role Variables
--------------

Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
20
21
22
23
`worker_name` creates a user as a given name. 
`worker_keyfile` is copied into /home/{{worker_name}}/.ssh. 

Use ansible-vault for keyfile.
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
24
25
26
27

Dependencies
------------

Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
28
No dependencies.
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
29
30
31
32

Example Playbook
----------------

Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
33
```
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
34
35
    - hosts: servers
      roles:
Oyvind.Gjesdal's avatar
mend    
Oyvind.Gjesdal committed
36
37
         - { role: worker, worker_name: "protege", worker_keyfile: private_key,   worker_git_email: "ubbdst@gmail.com"
 }
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
38
         - { role: worker, worker_name: "cron_worker" ...}
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
39
40
    - task:
        crontab:
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
41
          user: "cron_worker" 
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
42
43
          ...
```
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
44
45
46
47
48
49
50
51
License
-------

BSD

Author Information
------------------

Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
52