https://www.ansible.com/resources/whitepapers/ansible-in-depth
https://www.ansible.com/resources/whitepapers/benefits-of-agentless-architecture
https://www.ansible.com/resources/videos/quick-start-video
https://docs.ansible.com/
https://github.com/ansible/ansible/tree/devel/docs/docsite
https://www.ibm.com/developerworks/cn/linux/1608_lih_ansible/index.html
Ansible2.0 升级2.9指南
书籍
https://www.ansible.com/resources/ebooks?extIdCarryOver=true&sc_cid=701f2000001OH6uAAG
https://docs.ansible.com/ansible/2.9/modules/user_module.html
https://docs.ansible.com/ansible/2.9/modules/
https://docs.ansible.com/ansible/2.9/modules/list_of_commands_modules.html
安装、简单使用,快速看到效果,不过多解释细节
安装的时候epel源里,并没有显示多个版本
所谓环境"干净",尤其是系统里不能有太多pip安装的东西
如何很好的利用Ansible返回的JSON数据
https://www.cnblogs.com/morse/p/14036236.html
[root@192-168-31-106 /data/ysansible]# cat test2.yml
---
- hosts: all
tasks:
- name: ansible_default_ipv4['address']
debug:
msg: echo {{ ansible_default_ipv4['address'] }}
- name: ansible_host
debug:
msg: echo {{ ansible_host }}
- name: replace
debug:
msg: echo {{ ansible_host | regex_replace('\.', '-') }}
- hostname:
name: testname1
- name: set hostname
shell: hostnamectl set-hostname {{ ansible_host | regex_replace('\.', '-') }}
可能是忽略了 末尾的斜杠导致 https://www.cnblogs.com/hixiaowei/p/9068445.html
https://galaxy.ansible.com/docs/using/installing.html#id4
Determining Where Roles Are Installed
$ ansible-galaxy install --roles-path ~/ansible-roles debops.apt
Listing Your Installed Roles
$ ansible-galaxy list
[root@192_168_31_106 /data/galaxy]# ansible-galaxy install geerlingguy.apache geerlingguy.mysql geerlingguy.php
- downloading role 'apache', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-apache/archive/3.1.4.tar.gz
- extracting geerlingguy.apache to /root/.ansible/roles/geerlingguy.apache
- geerlingguy.apache (3.1.4) was installed successfully
- downloading role 'mysql', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-mysql/archive/3.3.0.tar.gz
- extracting geerlingguy.mysql to /root/.ansible/roles/geerlingguy.mysql
- geerlingguy.mysql (3.3.0) was installed successfully
- downloading role 'php', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-php/archive/4.5.1.tar.gz
- extracting geerlingguy.php to /root/.ansible/roles/geerlingguy.php
- geerlingguy.php (4.5.1) was installed successfully
[root@192_168_31_106 /data/galaxy]#
[root@192_168_31_106 /data/galaxy]#
[root@192_168_31_106 /data/galaxy]# ls -l
total 0
[root@192_168_31_106 /data/galaxy]#
[root@192_168_31_106 /data/galaxy]# ls -l
total 0
[root@192_168_31_106 /data/galaxy]#
[root@192_168_31_106 /data/galaxy]# ls
[root@192_168_31_106 /data/galaxy]# ls /root/.ansible/roles
geerlingguy.apache geerlingguy.mysql geerlingguy.php
roles/x/vars/main.yml 优先级比较高,比 roles/x/defaults/main.yml 里的高,一般不想让别人动动变量都放在 roles/x/vars/main.yml