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 | ||
a517d31d MJ |
24 | - name: Remove ubuntu user |
25 | user: | |
26 | name: ubuntu | |
27 | state: absent | |
28 | remove: yes | |
29 | ||
422aaa6e MJ |
30 | - name: Remove debian user |
31 | user: | |
32 | name: debian | |
33 | state: absent | |
34 | remove: yes | |
35 | ||
33436c91 MJ |
36 | - name: Create jenkins user |
37 | user: | |
38 | name: 'jenkins' | |
39 | ||
40 | - name: Set up authorized_keys for the jenkins user | |
41 | authorized_key: | |
42 | user: 'jenkins' | |
43 | key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDA3fwpioVLDoCQsQkYK5bOwPb8N0EXeYm2MleBQTfqxtKaqWWbmUtFXAiyclKHRspjcAiIKwwqLyhPopHBqJzmXnB0GsfGmxXJ6wSBgKJ4kdBVRM+nKlK0wCl1oQkFeV/Xl3jzt1Ey96XiNWlesfkvgcMCpsJzQ7/xRb9IcghskzlQbLOwDNir/156JgAYUYvOLqNCcE+xcgPxJGanfZDXTLkfBYxaeaB8isBPeEU6fhPvu/W055M1uB7E0qhcbFtuKCBu1Fg4jzsW4yDU8+ZB1b5mAXwEAuMbVGMrOf4rjtTpGpQd6XFsXpFT28NU1u5j2cUbtANJalkNDX/UY6XJ jenkins@ci-master-02' | |
44 | ||
a517d31d MJ |
45 | #- name: Create sudoers.d directory. |
46 | # file: | |
47 | # path: /etc/sudoers.d | |
48 | # owner: root | |
49 | # group: root | |
50 | # mode: 0755 | |
51 | # state: directory | |
52 | # | |
53 | #- name: Set includedir in /etc/sudoers. | |
54 | # lineinfile: | |
55 | # dest: /etc/sudoers | |
56 | # line: "#includedir /etc/sudoers.d" | |
57 | # state: present | |
58 | # validate: "/usr/sbin/visudo -cf %s" | |
59 | # | |
60 | #- name: Create jenkins sudoers file. | |
61 | # copy: | |
62 | # dest: "/etc/sudoers.d/jenkins" | |
63 | # content: "jenkins ALL=NOPASSWD: ALL" | |
64 | # mode: 0440 | |
65 | # owner: root | |
66 | # group: root | |
67 | # validate: "/usr/sbin/visudo -cf %s" | |
68 | ||
69 | - name: Remove jenkins sudoers file | |
3ea0152b | 70 | file: |
a517d31d MJ |
71 | path: "/etc/sudoers.d/jenkins" |
72 | state: absent |