以下是一个发布Cassandra.yaml的ansible playbook示例

..
#listen_address: localhost
listen_address: {{ inventory_hostname }}
.
.
#rpc_address: localhost
rpc_address: {{ inventory_hostname }}
..
 hosts: worker
  sudo: yes
  tasks:
   - name: copy cassandra.yaml
     template: src=./cassandra/cassandra.yaml.template dest=/opt/cassandra/conf/cassandra.yaml

执行ansible-playbook指令

ansible-playbook -h hosts cassandra.yaml -K

广告
将在 10 秒后关闭
bannerAds