任务没有被执行,Ansible
Tasks are not being executed, Ansible
我有一个 Ansible 剧本来为我们需要的最低配置配置服务器。这是我的脚本的一部分:
---
-
name: Install Git, OpenJDK, MySql, Docker, Bamboo
hosts: myservers
remote_user: root
vars:
bamboo: atlassian-bamboo
bamboover: 5.12.2.1
dlpath: software/bamboo/downloads/binary
tmp: /var/tmp
installto: opt
datahome: /srv/bamboo-data
svcuser: someuser
dbuser: someotheruser
dbpass: somepassword
tasks:
- name: install epel-release
yum: pkg=epel-release state=latest
- name: install the open-vm-tools, htop, mlocate, ansible, autoconf, wget, java-1.8.0-openjdk-headless.x86_64, Development tools
yum: state=present name={{item}}
with_items:
- open-vm-tools
- htop
- mlocate
- ansible
- autoconf
- wget
- java-1.8.0-openjdk-headless.x86_64
- "Development tools"
## The task gets here and it doesn't continue for some reason.
- name: Reboot the server after install
command: reboot
- name: wait for server to come back
local_action:
module: wait_for
host={{inventory_hostname}}
port=22
state=started
delay=1
timeout=300
sudo: false
- name: updatedb
command: updatedb >> playbook.log.txt
- name: install mysql, mysql-community-server
yum: name={{item}} state=present
with_items:
- http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
- mysql-community-server
- name: Start of mysqld
command: service mysqld start >> playbook.log.txt
[...] #Continues...
我不明白哪里出了问题。在我的调查过程中,我发现当无法访问主机时,ansible 存在一个已知问题(这就是我的情况)。相关问题:ISSUE 问题已解决,这是我的 Ansible 版本:
我尝试从我的 ansible 主机文件中删除所有主机,只留下一个我可以访问的主机。无济于事,它只是没有执行所有任务。
这是剧本的输出:
有人可以建议不同的方法或更好的解决方案吗?
包组必须以 @
为前缀。来自 Ansible yum module notes:
Package groups are specified as “@development-tools” and environment groups are “@^gnome-desktop-environment”.
我有一个 Ansible 剧本来为我们需要的最低配置配置服务器。这是我的脚本的一部分:
---
-
name: Install Git, OpenJDK, MySql, Docker, Bamboo
hosts: myservers
remote_user: root
vars:
bamboo: atlassian-bamboo
bamboover: 5.12.2.1
dlpath: software/bamboo/downloads/binary
tmp: /var/tmp
installto: opt
datahome: /srv/bamboo-data
svcuser: someuser
dbuser: someotheruser
dbpass: somepassword
tasks:
- name: install epel-release
yum: pkg=epel-release state=latest
- name: install the open-vm-tools, htop, mlocate, ansible, autoconf, wget, java-1.8.0-openjdk-headless.x86_64, Development tools
yum: state=present name={{item}}
with_items:
- open-vm-tools
- htop
- mlocate
- ansible
- autoconf
- wget
- java-1.8.0-openjdk-headless.x86_64
- "Development tools"
## The task gets here and it doesn't continue for some reason.
- name: Reboot the server after install
command: reboot
- name: wait for server to come back
local_action:
module: wait_for
host={{inventory_hostname}}
port=22
state=started
delay=1
timeout=300
sudo: false
- name: updatedb
command: updatedb >> playbook.log.txt
- name: install mysql, mysql-community-server
yum: name={{item}} state=present
with_items:
- http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
- mysql-community-server
- name: Start of mysqld
command: service mysqld start >> playbook.log.txt
[...] #Continues...
我不明白哪里出了问题。在我的调查过程中,我发现当无法访问主机时,ansible 存在一个已知问题(这就是我的情况)。相关问题:ISSUE 问题已解决,这是我的 Ansible 版本:
我尝试从我的 ansible 主机文件中删除所有主机,只留下一个我可以访问的主机。无济于事,它只是没有执行所有任务。
这是剧本的输出:
有人可以建议不同的方法或更好的解决方案吗?
包组必须以 @
为前缀。来自 Ansible yum module notes:
Package groups are specified as “@development-tools” and environment groups are “@^gnome-desktop-environment”.