有没有办法只在ansible剧本中运行一项任务?
例如,在中roles/hadoop_primary/tasks/hadoop_master.yml
。我有"start hadoop job tracker services"
任务 我可以执行一项任务吗?
hadoop_master.yml文件:
---
# Playbook for Hadoop master servers
- name: Install the namenode and jobtracker packages
apt: name={{item}} force=yes state=latest
with_items:
- hadoop-0.20-mapreduce-jobtracker
- hadoop-hdfs-namenode
- hadoop-doc
- hue-plugins
- name: start hadoop jobtracker services
service: name=hadoop-0.20-mapreduce-jobtracker state=started
tags:
debug