vultr 머신을 만들기 위해 다음 플레이북을 만들었습니다. 나는 ansible의 vultr 모듈을 사용하고 있으며 필요한 모든 매개변수를 넣었습니다.
---
# Ansible Blocks
- hosts: 127.0.0.1
# gather_facts: False
connection: local
tasks:
- block:
- name: List root
local_action:
module: vr_server
name: "myserver"
os: CentOS 7 x64
plan: 1024 MB RAM,25 GB SSD,1.00 TB BW
region: Amsterdam
api_key: "242HXXXXXXC3HGGXPSZTK7ILY4QUEC5KN555"
api_account: "john"
rescue:
- name: Only run when a task inside the block throws an error.
debug: msg="Something went wrong."
always:
- name: Always run.
debug: msg="Regardless of what happened above, we're done with this block!"
...
하지만 실행하면 다음과 같은 오류가 발생합니다.
fatal: [127.0.0.1 -> localhost]: FAILED! => {"changed": false, "msg": "Config file not found. Tried : /home/john/.vultr.ini, /home/john/automation/utils/ansible-vultr/core_vultr/vultr.ini"}
vultr.ini를 검색하는 것 같습니다. 왜 그런가요? vultr.ini 파일에 무엇을 넣어야 하나요?
Ansible 버전은 2.5.0이며 우분투 14.04에서 실행됩니다.
답변1
다음 링크가 바로 귀하가 찾고 있는 링크인 것 같습니다.https://www.renemoser.net/blog/2018/03/18/begin-vultr-with-ansible/
특히 다음 비트가 필요할 수 있습니다.
[default]
key = <your api key>