From: Michael Jeanson Date: Thu, 25 May 2017 15:25:57 +0000 (-0400) Subject: ansible: Remove jenkins sudoers and delete ubuntu user X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a517d31d04c7c14f43e3600f393323149c8d9cf6;p=lttng-ci.git ansible: Remove jenkins sudoers and delete ubuntu user Signed-off-by: Michael Jeanson --- diff --git a/automation/ansible/roles/common/tasks/main.yml b/automation/ansible/roles/common/tasks/main.yml index f756faa..6e4253e 100644 --- a/automation/ansible/roles/common/tasks/main.yml +++ b/automation/ansible/roles/common/tasks/main.yml @@ -18,6 +18,12 @@ - include: setup-Alpine.yml when: ansible_os_family == 'Alpine' +- name: Remove ubuntu user + user: + name: ubuntu + state: absent + remove: yes + - name: Create jenkins user user: name: 'jenkins' @@ -27,26 +33,31 @@ user: 'jenkins' key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDA3fwpioVLDoCQsQkYK5bOwPb8N0EXeYm2MleBQTfqxtKaqWWbmUtFXAiyclKHRspjcAiIKwwqLyhPopHBqJzmXnB0GsfGmxXJ6wSBgKJ4kdBVRM+nKlK0wCl1oQkFeV/Xl3jzt1Ey96XiNWlesfkvgcMCpsJzQ7/xRb9IcghskzlQbLOwDNir/156JgAYUYvOLqNCcE+xcgPxJGanfZDXTLkfBYxaeaB8isBPeEU6fhPvu/W055M1uB7E0qhcbFtuKCBu1Fg4jzsW4yDU8+ZB1b5mAXwEAuMbVGMrOf4rjtTpGpQd6XFsXpFT28NU1u5j2cUbtANJalkNDX/UY6XJ jenkins@ci-master-02' -- name: Create sudoers.d directory. +#- name: Create sudoers.d directory. +# file: +# path: /etc/sudoers.d +# owner: root +# group: root +# mode: 0755 +# state: directory +# +#- name: Set includedir in /etc/sudoers. +# lineinfile: +# dest: /etc/sudoers +# line: "#includedir /etc/sudoers.d" +# state: present +# validate: "/usr/sbin/visudo -cf %s" +# +#- name: Create jenkins sudoers file. +# copy: +# dest: "/etc/sudoers.d/jenkins" +# content: "jenkins ALL=NOPASSWD: ALL" +# mode: 0440 +# owner: root +# group: root +# validate: "/usr/sbin/visudo -cf %s" + +- name: Remove jenkins sudoers file file: - path: /etc/sudoers.d - owner: root - group: root - mode: 0755 - state: directory - -- name: Set includedir in /etc/sudoers. - lineinfile: - dest: /etc/sudoers - line: "#includedir /etc/sudoers.d" - state: present - validate: "/usr/sbin/visudo -cf %s" - -- name: Create jenkins sudoers file. - copy: - dest: "/etc/sudoers.d/jenkins" - content: "jenkins ALL=NOPASSWD: ALL" - mode: 0440 - owner: root - group: root - validate: "/usr/sbin/visudo -cf %s" + path: "/etc/sudoers.d/jenkins" + state: absent