Commit | Line | Data |
---|---|---|
3ea0152b MJ |
1 | --- |
2 | # Include variables and define needed variables. | |
3 | - name: Include OS-specific variables. | |
4 | include_vars: "{{ ansible_os_family }}.yml" | |
5 | ||
6 | - name: Define common_packages. | |
7 | set_fact: | |
8 | common_packages: "{{ __common_packages | list }}" | |
9 | when: common_packages is not defined | |
10 | ||
11 | # Setup/install tasks. | |
12 | - include: setup-RedHat.yml | |
13 | when: ansible_os_family == 'RedHat' | |
14 | ||
15 | - include: setup-Debian.yml | |
16 | when: ansible_os_family == 'Debian' | |
17 | ||
1be0d012 MJ |
18 | - include: setup-Alpine.yml |
19 | when: ansible_os_family == 'Alpine' | |
20 | ||
599b56d0 MJ |
21 | - include: setup-Suse.yml |
22 | when: ansible_os_family == 'Suse' | |
23 | ||
5e186c3f MJ |
24 | - name: Set up authorized_keys for the root user |
25 | authorized_key: | |
26 | user: 'root' | |
27 | key: '{{ item }}' | |
28 | with_file: | |
29 | - public_keys/mjeanson.pub | |
30 | - public_keys/joraj.pub | |
31 | - public_keys/jgalar.pub | |
32 | - public_keys/frdeso.pub | |
33 | - public_keys/mdesnoyers.pub | |
34 | - public_keys/smarchi.pub | |
35 | - public_keys/pproulx.pub | |
36 | ||
a517d31d MJ |
37 | - name: Remove ubuntu user |
38 | user: | |
39 | name: ubuntu | |
40 | state: absent | |
41 | remove: yes | |
42 | ||
422aaa6e MJ |
43 | - name: Remove debian user |
44 | user: | |
45 | name: debian | |
46 | state: absent | |
47 | remove: yes | |
48 | ||
33436c91 MJ |
49 | - name: Create jenkins user |
50 | user: | |
51 | name: 'jenkins' | |
52 | ||
53 | - name: Set up authorized_keys for the jenkins user | |
54 | authorized_key: | |
55 | user: 'jenkins' | |
56 | key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDA3fwpioVLDoCQsQkYK5bOwPb8N0EXeYm2MleBQTfqxtKaqWWbmUtFXAiyclKHRspjcAiIKwwqLyhPopHBqJzmXnB0GsfGmxXJ6wSBgKJ4kdBVRM+nKlK0wCl1oQkFeV/Xl3jzt1Ey96XiNWlesfkvgcMCpsJzQ7/xRb9IcghskzlQbLOwDNir/156JgAYUYvOLqNCcE+xcgPxJGanfZDXTLkfBYxaeaB8isBPeEU6fhPvu/W055M1uB7E0qhcbFtuKCBu1Fg4jzsW4yDU8+ZB1b5mAXwEAuMbVGMrOf4rjtTpGpQd6XFsXpFT28NU1u5j2cUbtANJalkNDX/UY6XJ jenkins@ci-master-02' | |
57 | ||
a517d31d MJ |
58 | #- name: Create sudoers.d directory. |
59 | # file: | |
60 | # path: /etc/sudoers.d | |
61 | # owner: root | |
62 | # group: root | |
63 | # mode: 0755 | |
64 | # state: directory | |
65 | # | |
66 | #- name: Set includedir in /etc/sudoers. | |
67 | # lineinfile: | |
68 | # dest: /etc/sudoers | |
69 | # line: "#includedir /etc/sudoers.d" | |
70 | # state: present | |
71 | # validate: "/usr/sbin/visudo -cf %s" | |
72 | # | |
73 | #- name: Create jenkins sudoers file. | |
74 | # copy: | |
75 | # dest: "/etc/sudoers.d/jenkins" | |
76 | # content: "jenkins ALL=NOPASSWD: ALL" | |
77 | # mode: 0440 | |
78 | # owner: root | |
79 | # group: root | |
80 | # validate: "/usr/sbin/visudo -cf %s" | |
81 | ||
82 | - name: Remove jenkins sudoers file | |
3ea0152b | 83 | file: |
a517d31d MJ |
84 | path: "/etc/sudoers.d/jenkins" |
85 | state: absent |