ansible-taler-exchange

Ansible playbook to deploy a production Taler Exchange
Log | Files | Refs | README | LICENSE

disable.yml (991B)


      1 ---
      2 - name: Remove devtesting sudo access and managed login keys
      3   ansible.builtin.file:
      4     path: "{{ item }}"
      5     state: absent
      6   loop:
      7     - /etc/sudoers.d/devtesting
      8     - /home/devtesting/.ssh/authorized_keys
      9     - /usr/local/bin/taler-devtesting
     10     - /usr/local/bin/taler-devtesting-exchange-challenger-setup
     11 
     12 - name: Find the existing devtesting account
     13   ansible.builtin.getent:
     14     database: passwd
     15     key: devtesting
     16     fail_key: false
     17 
     18 - name: Disable the existing account without removing its home
     19   ansible.builtin.user:
     20     name: devtesting
     21     password_lock: true
     22     expires: 1
     23     shell: /usr/sbin/nologin
     24   when: ansible_facts.getent_passwd.devtesting is not none
     25 
     26 - name: Terminate existing devtesting sessions
     27   ansible.builtin.command:
     28     argv: [pkill, -KILL, -u, devtesting]
     29   register: devtesting_terminate
     30   changed_when: devtesting_terminate.rc == 0
     31   failed_when: devtesting_terminate.rc not in [0, 1]
     32   when: ansible_facts.getent_passwd.devtesting is not none