Skip to content

ansible collection for thinkphp, with nginx/php-fpm/swoole/mariadb

License

Notifications You must be signed in to change notification settings

goldeagle/ansible-collection-thinkphp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Collections - thinkphp_tech.thinkphp | 中文

Ansible collections for thinkphp (v6.x) framework

Table of Contents

  1. Description
  2. Technical Overview
    2.1. PHP Extensions & Tools
    2.2. Supported OSs
  3. Quick Start
  4. Software Lists
    4.1. Web services
    4.2. DataBase services
    4.3. KV & MQ services
    4.4. PHP & extensions
    4.5. Misc

1. Description

Ansible collections for thinkphp (v6.x) framework, with swoole & pecl & composer installation.

2. Technical Overview

2.1. PHP Extensions & Tools

  • swoole - server side softwares with swoole extension
  • pecl - php extension community library
  • composer - php package tool

2.2. Tested OSs

  • Debian
  • Ubuntu
  • Kali
  • CentOS
  • Fedora
  • Gentoo
  • MacOS

3. Quick Start

3.1. Install ansible

First of all, install "ansible"

  • Linux:
$ apt install ansible
  • MacOS:
$ brew install ansible

3.2. Add a user for 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 }}

3.3. Install this collection

Install this collection:

$ ansible-galaxy collection install thinkphp_tech.thinkphp

3.4. Create a playbook file to use the collection

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

4. Software Lists

4.1. Web services

  • apache
  • nginx
  • varnish

4.2. DataBase services

  • mariadb
  • mysql
  • postgresql
  • sqlite3
  • tidb

4.3. KV & MQ services

  • beanstalkd
  • memcached
  • redis
  • rabbitmq

4.4. PHP & extensions

  • php-cli
  • php-fpm
  • php-redis
  • swoole
  • xdebug
  • xhprof
  • composer

4.5. Misc

  • git
  • vsftpd
  • byobu
  • tmux
  • htop
  • iftop
  • dstat
  • hdparm
  • iotop
  • multitail
  • net-tools
  • unzip
  • pixz
  • vim
  • zsh
  • nodejs (with yarn, n, gulp, grunt, vue-cli)

About

ansible collection for thinkphp, with nginx/php-fpm/swoole/mariadb

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages