ansible: Warum sucht es nach der Datei vultr.ini?

ansible: Warum sucht es nach der Datei vultr.ini?

Ich habe das folgende Playbook erstellt, um eine Vultr-Maschine zu erstellen. Ich verwende das Vultr-Modul von Ansible und habe alle erforderlichen Parameter eingegeben;

---

# 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!"

...

Aber wenn ich es ausführe, erhalte ich die folgende Fehlermeldung:

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"}

Es sieht so aus, als würde es nach vultr.ini suchen. Warum ist das so? Was soll ich in die Datei vultr.ini schreiben?

Die Version von Ansible ist 2.5.0 und läuft auf Ubuntu 14.04.

Antwort1

Dieser Link scheint genau das zu sein, was Sie suchen:https://www.renemoser.net/blog/2018/03/18/begin-vultr-with-ansible/

Insbesondere benötigen Sie möglicherweise Folgendes:

[default]
key = <your api key>

verwandte Informationen