Ansible自动化之批量更新代码

剧本详情

请根据实际情况进行修改剧本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
---
- hosts: "{{ hosts }}"
remote_user: "{{ user }}"
gather_facts: true
become: yes
become_user: root
become_method: sudo

tasks:
- name: git pull
git:
repo: 'https://gituser:gitpasswd@github.com/git/git.git'
dest: /data/servers/webapps
update: yes
force: no
version: master