Browse Source

add 1password variant

master
Markus Bergholz 1 year ago
parent
commit
e6c306b86a
1 changed files with 32 additions and 0 deletions
  1. +32
    -0
      ansible/rotate_aws_1password.yml

+ 32
- 0
ansible/rotate_aws_1password.yml View File

@ -0,0 +1,32 @@
---
- hosts: localhost
connection: local
gather_facts: False
vars_prompt:
- name: AWS_PROFILE
prompt: AWS Profile?
private: no
default: test
- name: ONE_PASSWORD_ITEM
prompt: onepassword item?
private: no
default: aws prod
vars:
PASSWORD: "{{ lookup('onepassword', ONE_PASSWORD_ITEM, field='password', vault='Private') }}"
USERNAME: "{{ lookup('onepassword', ONE_PASSWORD_ITEM, field='username', vault='Private') }}"
tasks:
- name: Get the current caller identity facts
aws_caller_info:
profile: "{{ AWS_PROFILE }}"
register: caller_facts
- name: update iam password
iam:
iam_type: user
profile: "{{ AWS_PROFILE }}"
name: "{{ USERNAME }}"
state: present
password: "{{ PASSWORD }}"

Loading…
Cancel
Save