几天前我开始使用 semaphore-ui,所以我还不是很熟悉。我让它在 docker 容器中运行,并在“密钥库”中定义了多个条目,并在“任务模板”下成功运行了多个 Ansible Playbook
我有这个剧本,可以发送电子邮件
- name: Send email using Ansible
hosts: localhost
gather_facts: no
tasks:
- name: Send email
community.general.mail:
to:
- email1@domain.net
- email2@domain.com
from: from@domain.com
username: user@domain.com
password: pass_here
host: smtp.office365.com
port: 587
charset: "utf-8"
secure: starttls
subject: "Ansible Email"
body: |
This is a test email sent from an Ansible playbook.
The email supports multiple lines.
Best regards,
Your Ansible Automation Team
但是我不希望电子邮件帐户的密码在剧本中被硬编码。我需要在信号量中的某个地方定义它,然后从剧本中访问它。
我怎样才能做到这一点?