Ansible Collections - thinkphp_tech.thinkphp | 中文
Ansible collections for thinkphp (v6.x) framework
- Description
- Technical Overview
2.1. PHP Extensions & Tools
2.2. Supported OSs - Quick Start
- Software Lists
4.1. Web services
4.2. DataBase services
4.3. KV & MQ services
4.4. PHP & extensions
4.5. Misc
Ansible collections for thinkphp (v6.x) framework, with swoole & pecl & composer installation.
- swoole - server side softwares with swoole extension
- pecl - php extension community library
- composer - php package tool
- Debian
- Ubuntu
- Kali
- CentOS
- Fedora
- Gentoo
- MacOS
First of all, install "ansible"
- Linux:
$ apt install ansible
- MacOS:
$ brew install ansible
Add user:
$ useradd {{ your_ansible_user }}-m -G users,sudo -s /bin/bash
$ passwd
$ mkdir -p ~/.ssh
Generate ssh key pair:
$ ssh-keygen -t rsa -b 4096 -C "{{ your_ansible_user }}"
Deploy the pub key:
$ scp .ssh/id_rsa.pub {{ your_ansible_user }}@{{ target_host }}:~/.ssh/authorized_keys
Test it:
$ ssh -T {{ your_ansible_user }}@{{ target_host }}
Install this collection:
$ ansible-galaxy collection install thinkphp_tech.thinkphp
Then you can use the roles from the collection in your playbooks (playbook.yml etc.):
---
- name : configure and deploy the local servers and app codes
hosts: {{ your_host_group_in_your_inventory }}
remote_user: {{ your_remote_ansible_user }}
become: yes
become_method: sudo
vars:
ansible_python_interpreter: /usr/bin/python3
php_install_composer: true
php_install_pecl: true
php_install_redis: true
php_install_swoole: true
php_install_xdebug: true
php_install_xhprof: true
collections:
- thinkphp_tech.thinkphp
roles:
- common
- nginx
- php
- redis
- git
Run the playbook:
$ ansible-playbook -i <your_hosts_file> playbook.yml -K
Here are some playbook examples: thinkphp-tech/ansible-examples
- apache
- nginx
- varnish
- mariadb
- mysql
- postgresql
- sqlite3
- tidb
- beanstalkd
- memcached
- redis
- rabbitmq
- php-cli
- php-fpm
- php-redis
- swoole
- xdebug
- xhprof
- composer
- git
- vsftpd
- byobu
- tmux
- htop
- iftop
- dstat
- hdparm
- iotop
- multitail
- net-tools
- unzip
- pixz
- vim
- zsh
- nodejs (with yarn, n, gulp, grunt, vue-cli)