今天,我试图用基于角色的方法为Jenkin编写一本ansible剧本。但是我在这里面临一些问题,下面是我用来创建Jenkins的语法。
Approch1 - site.yml
---
- name: Install Jenkins
hosts: localhost
gather_facts: false
become: true
include_role:
name: jenkins
它给了我以下的错误。
ERROR! 'include_role' is not a valid attribute for a Play
The erro
我已经在windows上使用PowerShell中的Choco安装了Python。它起作用了。
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
我还从pip安装了ansible。
ansible==2.3.0.0
但是当我
我正在学习Ansible,但我对在playbook中何时使用连字符以及何时不使用连字符感到困惑。据我所知,在Ansible中,list使用连字符。
例如,
--- # my first playbook
- hosts: webservers ( why did we use hyphen here it is not a list)
tasks:
- name: installing httpd
yum: name=httpd state=installed ( why we shouldn't use hy