2

我有一个重要的任务,我在其中传递硬编码的密码值。

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 脚本中传递这些值。

在此处输入图像描述

4

1 回答 1

0

看看aws_ssmansible 的插件。

例子:

- 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
于 2019-01-25T18:25:13.233 回答