Geen omschrijving
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

google_auth.yml 1.2KB

12345678910111213141516171819202122232425
  1. ---
  2. # Defines tasks applicable for Google Authenticator
  3. - name: Ensure required packages are installed
  4. apt: pkg={{ item }} state=present
  5. with_items:
  6. - libqrencode3
  7. - libpam-dev
  8. #- libpam-google-authenticator wasn't available in wheezy
  9. - name: Download Google authenticator pam module
  10. get_url: url=https://google-authenticator.googlecode.com/files/libpam-google-authenticator-{{ google_auth_version }}-source.tar.bz2 dest=/root/libpam-google-authenticator-{{ google_auth_version }}-source.tar.bz2
  11. - name: Extract Google authenticator
  12. command: tar xjf libpam-google-authenticator-{{ google_auth_version }}-source.tar.bz2 chdir=/root creates=/root/libpam-google-authenticator-{{ google_auth_version }}
  13. - name: Install Google authenticator
  14. command: make install chdir=/root/libpam-google-authenticator-{{ google_auth_version }} creates=/usr/local/bin/google-authenticator
  15. - name: Update sshd config to enable challenge responses
  16. lineinfile: dest=/etc/ssh/sshd_config regexp=^ChallengeResponseAuthentication line="ChallengeResponseAuthentication yes" state=present
  17. notify: restart ssh
  18. - name: Add Google authenticator to PAM
  19. lineinfile: dest=/etc/pam.d/sshd line="auth required pam_google_authenticator.so" insertbefore=BOF state=present