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.
 
 
 
 
 
 

28 lines
685 B

  1. ---
  2. - hosts: localhost
  3. connection: local
  4. gather_facts: False
  5. vars_prompt:
  6. - name: AWS_PROFILE
  7. prompt: AWS Profile?
  8. private: no
  9. default: test
  10. - name: ONE_PASSWORD_ITEM
  11. prompt: onepassword item?
  12. private: no
  13. default: aws prod
  14. vars:
  15. PASSWORD: "{{ lookup('onepassword', ONE_PASSWORD_ITEM, field='password', vault='Private') }}"
  16. USERNAME: "{{ lookup('onepassword', ONE_PASSWORD_ITEM, field='username', vault='Private') }}"
  17. tasks:
  18. - name: update iam password
  19. iam:
  20. iam_type: user
  21. profile: "{{ AWS_PROFILE }}"
  22. name: "{{ USERNAME }}"
  23. state: present
  24. password: "{{ PASSWORD }}"