于志腾的技术专栏 PHP and Python and Vue Coder

Ansible之代码部署

2019-07-11
YztSon

阅读:


Ansible 的配置目录

macbookpro@bogon  /etc/ansible  tree
.
├── ansible.cfg
├── hosts

yum包管理配置源

/etc/yum.repos.d

代码部署

如果机器上没有git 先要安装,注意下面的执行命令要用双引号

ansible one -m git -a "repo=https://github.com/buqiucdn/buqiucdn.github.io dest=/opt/imoocc version=HEAD" -f 5 -l 192.168.0.108

192.168.0.108 | CHANGED => {
    "after": "9b0f58b04bca0d266b6c633b873471229cfb2568",
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "before": "HEAD",
    "changed": true,
    "remote_url_changed": false
}

Similar Posts

上一篇 Ansible之ad-hoc

下一篇 playbook的组成

Comments