运行以下攻略语法似乎是正确的,但得到以下错误!-
ERROR! 'blockinfile' is not a valid attribute for a Play
The error appears to have been in '/root/playbook1.yml': line 2, column 3, but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: insert
我想在运行攻略完成后在Ansible中显示一条横幅消息,为下一步提供说明。这就是我所做的:
- name: display post install message
debug:
msg: |
Things left to do:
- enable dash to dock gnome plugin in gnome tweal tool
- install SpaceVim plugins: vim "+call dein#install()" +qa
- git clone the dotfiles r
我有一组Ansible攻略,主yml文件如下所示
- hosts: all
roles:
- common
- install_nginx
我想在触发攻略时添加确认消息。我试过了,但不起作用
- hosts: all
vars_prompt:
- name: CONFIRM
prompt: Just to confirm you will install stuff
tasks:
- fail: no deployment this time
when: CONFIRM != 'yes'
roles:
我正在编写我的第一个Ansible攻略,以从AWS获取一些实例详细信息,但我无法正确地获取攻略。我得到了这个错误:ERROR! playbooks must be a list of plays。 下面是我的攻略。 #get vailable instance details
-name: "Create and attach ebs volumes"
tasks:
ec2_instance_facts:
region: us-west-2
filter :
"tag:role": Pri
我计划使用Ansible playbook在远程服务器上执行一个shell脚本。
空白test.sh文件:
touch test.sh
攻略:
---
- name: Transfer and execute a script.
hosts: server
user: test_user
sudo: yes
tasks:
- name: Transfer the script
copy: src=test.sh dest=/home/test_user mode=0777
- name: Execute the script
l