From e6bd68fb81353e3872e6472be707b428c7d269fc Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Mon, 10 Jun 2019 12:50:15 +0200 Subject: [PATCH] ansible-playbooks/general#85 Linting --- tasks/cleanup.yml | 8 ++++---- tasks/main.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tasks/cleanup.yml b/tasks/cleanup.yml index 6207349..025152d 100644 --- a/tasks/cleanup.yml +++ b/tasks/cleanup.yml @@ -5,23 +5,23 @@ --- # file: cleanup.yml -- name: "Grab the user list" +- name: Grab the user list shell: cat /etc/passwd register: passwd -- name: "Unlock legitimate user accounts" +- name: Unlock legitimate user accounts command: usermod --unlock {{item.split(':').0}} when: item.split(':').0 in users and item.split(':').2|int > 499 with_items: '{{ passwd.stdout_lines }}' -- name: "Lock deprecated user accounts" +- name: Lock deprecated user accounts command: usermod --lock {{item.split(':').0}} when: item.split(':').0 not in users and item.split(':').2|int > 499 with_items: '{{ passwd.stdout_lines }}' -- name: "Disable ssh keys for deprecated user accounts" +- name: Disable ssh keys for deprecated user accounts command: rm {{item.split(':').5}}/.ssh/authorized_keys when: item.split(':').0 not in users and item.split(':').2|int > 499 diff --git a/tasks/main.yml b/tasks/main.yml index be1bff7..f615a5e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -5,7 +5,7 @@ --- # file: main.yml -- name: "Check requirements: is the user hash defined" +- name: Check requirements: is the user hash defined local_action: shell echo "There are no users defined" when: not users changed_when: false -- GitLab