Ansible | AWS参数存储|积分

时间:2019-01-25 18:04:03

标签: amazon-web-services ansible aws-secrets-manager aws-parameter-store

我有一个艰巨的任务,我要传递密码值的硬编码。

Ansible脚本:-

- name: Airflow
  rabbitmq_user:
    user: airflow
    password: password
    state: present
    force: yes
  become: yes
  become_method: sudo
  become_user: root
  register: airflow_dbsetup
  notify:
    - restart rabbitmq-server

现在,我已经创建了如下所示的AWS参数存储。如何在我的ansible脚本中传递这些值。

enter image description here

1 个答案:

答案 0 :(得分:0)

看看enter image description here插件的ansible。

示例:

- name: Airflow
  rabbitmq_user:
    user: "{{ lookup('aws_ssm', 'rabbitmq_user', region='us-east-1') }}"
    password: "{{ lookup('aws_ssm', 'rabbitmq_password', region='us-east-1') }}
    state: present
    force: yes
  become: yes
  become_method: sudo
  become_user: root
  register: airflow_dbsetup
  notify:
    - restart rabbitmq-server