Я установил ansible с помощью следующих команд.
sudo apt-add-repository ppa:ansible/ansible
sudo apt update
sudo apt install ansible
После того, как я следовал за этим Ссылка .Используя это, я создал файл yml с именем test.yml (код показан ниже)
- name: test my new module
hosts: 127.0.1
tasks:
- name: run the new module
my_test:
name: 'hello'
new: true
register: testout
- name: dump test output
debug:
msg: '{{ testout }}'
Затем я запускаю ansible-playbook ./test.yml
.Я получаю следующую ошибку.
Понятия не имею, где я пропустил.Любая идея приветствуется.Большое вам спасибо.
sato:~/play_around_with_ansible$ ansible-playbook ./test.yml
[WARNING]: provided hosts list is empty, only localhost is available. Note
that the implicit localhost does not match 'all'
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.
The error appears to be in '/home/ven/play_around_with_ansible/test.yml': line 4, column 5, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
tasks:
- name: run the new module
^ here