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