我正在尝试运行AWS-RunAnsiblePlaybook,同时查找参数存储区以获取mysql的凭证。似乎与aws_ssm查找模块有关。
我收到以下错误。
这是我的剧本
- hosts: all
become: yes
vars:
mysql_hostname: "{{ lookup('aws_ssm', 'mysql_hostname', region='ap-southeast-2') }}"
mysql_database_name: "{{ lookup('aws_ssm', 'mysql_database_name', region='ap-southeast-2') }}"
mysql_user_name: "{{ lookup('aws_ssm', 'mysql_user_name', region='ap-southeast-2') }}"
mysql_password: "{{ lookup('aws_ssm', 'mysql_password', region='ap-southeast-2') }}"
tasks:
- name: gather ec2 facts
action: ec2_metadata_facts
- name: install bzip2 on redhat or centos instances
yum: name=bzip2 state=present
when: ansible_os_family == "RedHat"
- name: install bzip2 on debian or ubuntu instances
apt: name=bzip2 state=present
when: ansible_os_family == "Debian"
- name: dump database
mysql_db: name={{mysql_database_name}} login_host={{mysql_hostname}} login_user={{mysql_user_name}} login_password={{mysql_password}} state=dump target=/tmp/{{mysql_database_name}}.sql.gz'''
'''
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while templating '{{ lookup(aws_ssm, mysql_database_name, region=ap-southeast-2) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ lookup(aws_ssm, mysql_database_name, region=ap-southeast-2) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ lookup(aws_ssm, mysql_database_name, region=ap-southeast-2) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ lookup(aws_ssm, mysql_database_name, region=ap-southeast-2) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ lookup(aws_ssm, mysql_database_name, region=ap-southeast-2) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ lookup(aws_ssm, mysql_database_name, region=ap-southeast-2) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ lookup(aws_ssm, mysql_database_name, region=ap-southeast-2) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ lookup(aws_ssm, mysql_database_name, region=ap-southeast-2) }}'. Error wa
---Output truncated---
任何帮助将不胜感激