lxc-php-buster #85
|
@ -7,3 +7,6 @@
|
||||||
|
|
||||||
- name: Reload php73-fpm
|
- name: Reload php73-fpm
|
||||||
command: "lxc-attach -n php73 -- systemctl reload php7.3-fpm"
|
command: "lxc-attach -n php73 -- systemctl reload php7.3-fpm"
|
||||||
|
|
||||||
|
- name: Restart opensmtpd
|
||||||
|
command: "lxc-attach -n php73 -- systemctl restart opensmtpd"
|
||||||
|
|
|
@ -23,27 +23,8 @@
|
||||||
command: "lxc-attach -n {{name}} -- apt-get update"
|
command: "lxc-attach -n {{name}} -- apt-get update"
|
||||||
when: name == 'php73'
|
when: name == 'php73'
|
||||||
|
|
||||||
- name: Install requirements for sury repository
|
|
||||||
command: "lxc-attach -n {{name}} -- apt-get install -y --no-install-recommends wget apt-transport-https ca-certificates gnupg"
|
|
||||||
when: name == 'php73'
|
|
||||||
|
|
||||||
- name: Add sury APT repository
|
|
||||||
copy:
|
|
||||||
content: "deb https://packages.sury.org/php/ stretch main"
|
|
||||||
dest: "/var/lib/lxc/{{name}}/rootfs/etc/apt/sources.list.d/sury.list"
|
|
||||||
mode: "0644"
|
|
||||||
when: name == 'php73'
|
|
||||||
|
|
||||||
- name: Add sury GPG key
|
|
||||||
shell: "wget -O- https://packages.sury.org/php/apt.gpg |lxc-attach -n {{name}} -- apt-key add -"
|
|
||||||
when: name == 'php73'
|
|
||||||
|
|
||||||
- name: Update APT cache
|
|
||||||
command: "lxc-attach -n {{name}} -- apt-get update"
|
|
||||||
when: name == 'php73'
|
|
||||||
|
|
||||||
- name: Install PHP packages
|
- name: Install PHP packages
|
||||||
command: "lxc-attach -n {{name}} -- apt-get install -y php7.3 php7.3-fpm php7.3-cli php7.3-curl php7.3-mysql php7.3-pgsql php7.3-ldap php7.3-imap php7.3-gd php-ssh2 php-gettext composer libphp-phpmailer ssmtp git zip unzip php7.3-zip"
|
command: "lxc-attach -n {{name}} -- /bin/bash -c 'export DEBIAN_FRONTEND=noninteractive && apt-get install -y php-fpm php-cli php-gd php-intl php-imap php-ldap php-mysql php-pgsql php-gettext php-curl php-ssh2 composer libphp-phpmailer opensmtpd git zip unzip php-zip'"
|
||||||
when: name == 'php73'
|
when: name == 'php73'
|
||||||
|
|
||||||
- name: Copy evolinux PHP 5.6 configuration
|
- name: Copy evolinux PHP 5.6 configuration
|
||||||
|
@ -90,18 +71,36 @@
|
||||||
name: "/var/lib/lxc/{{name}}/rootfs/etc/ssmtp/ssmtp.conf"
|
name: "/var/lib/lxc/{{name}}/rootfs/etc/ssmtp/ssmtp.conf"
|
||||||
regexp: "^mailhub=.*$"
|
regexp: "^mailhub=.*$"
|
||||||
replace: "mailhub=127.0.0.1"
|
replace: "mailhub=127.0.0.1"
|
||||||
|
when: name != 'php73'
|
||||||
|
|
||||||
- name: Configure ssmtp
|
- name: Configure ssmtp
|
||||||
replace:
|
replace:
|
||||||
name: "/var/lib/lxc/{{name}}/rootfs/etc/ssmtp/ssmtp.conf"
|
name: "/var/lib/lxc/{{name}}/rootfs/etc/ssmtp/ssmtp.conf"
|
||||||
regexp: "^#FromLineOverride=.*$"
|
regexp: "^#FromLineOverride=.*$"
|
||||||
replace: "FromLineOverride=YES"
|
replace: "FromLineOverride=YES"
|
||||||
|
when: name != 'php73'
|
||||||
|
|
||||||
- name: Configure ssmtp
|
- name: Configure ssmtp
|
||||||
replace:
|
replace:
|
||||||
name: "/var/lib/lxc/{{name}}/rootfs/etc/ssmtp/ssmtp.conf"
|
name: "/var/lib/lxc/{{name}}/rootfs/etc/ssmtp/ssmtp.conf"
|
||||||
regexp: "^hostname=.*"
|
regexp: "^hostname=.*"
|
||||||
replace: "hostname={{ansible_fqdn}}"
|
replace: "hostname={{ansible_fqdn}}"
|
||||||
|
when: name != 'php73'
|
||||||
|
|
||||||
|
- name: Configure opensmtpd
|
||||||
|
template:
|
||||||
|
src: smtpd.conf.j2
|
||||||
|
dest: "/var/lib/lxc/{{name}}/rootfs/etc/smtpd.conf"
|
||||||
|
mode: "0644"
|
||||||
|
notify: "Restart opensmtpd"
|
||||||
|
when: name == 'php73'
|
||||||
|
|
||||||
|
- name: Configure mailname
|
||||||
|
template:
|
||||||
|
src: mailname.j2
|
||||||
|
dest: "/var/lib/lxc/{{name}}/rootfs/etc/mailname"
|
||||||
|
notify: "Restart opensmtpd"
|
||||||
|
when: name == 'php73'
|
||||||
|
|
||||||
- name: Configure timezone
|
- name: Configure timezone
|
||||||
copy:
|
copy:
|
||||||
|
|
14
lxc-php/templates/smtpd.conf.j2
Normal file
14
lxc-php/templates/smtpd.conf.j2
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# This is the smtpd server system-wide configuration file.
|
||||||
|
# See smtpd.conf(5) for more information.
|
||||||
|
|
||||||
|
# To accept external mail, replace with: listen on all
|
||||||
|
#listen on localhost
|
||||||
|
|
||||||
|
# If you edit the file, you have to run "smtpctl update table aliases"
|
||||||
|
table aliases file:/etc/aliases
|
||||||
|
|
||||||
|
# Uncomment the following to accept external mail for domain "example.org"
|
||||||
|
#accept from any for domain "example.org" alias <aliases> deliver to mbox
|
||||||
|
|
||||||
|
accept for local alias <aliases> deliver to mbox
|
||||||
|
accept for any relay via "smtp://127.0.0.1"
|
|
@ -3,7 +3,7 @@
|
||||||
lxc_unprivilegied_containers: false
|
lxc_unprivilegied_containers: false
|
||||||
|
|
||||||
# Network type to use. See lxc.container.conf(5).
|
# Network type to use. See lxc.container.conf(5).
|
||||||
lxc_network_type: "none"
|
lxc_net_0_type: "none"
|
||||||
|
|
||||||
# Partition to bind mount into containers.
|
# Partition to bind mount into containers.
|
||||||
lxc_mount_part: "/home"
|
lxc_mount_part: "/home"
|
||||||
|
@ -15,4 +15,6 @@ lxc_mount_part: "/home"
|
||||||
# release: jessie
|
# release: jessie
|
||||||
# - name: php70
|
# - name: php70
|
||||||
# release: stretch
|
# release: stretch
|
||||||
|
# - name: php73
|
||||||
|
# release: buster
|
||||||
lxc_containers: []
|
lxc_containers: []
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
register: container_exists
|
register: container_exists
|
||||||
|
|
||||||
- name: Create container
|
- name: Create container
|
||||||
command: "lxc-create --name {{name}} --template debian --bdev dir --logfile /var/log/lxc/lxc-{{name}}.log --logpriority INFO -- --arch amd64 --release {{release}}"
|
command: "lxc-create --name {{name}} --template download --bdev dir --logfile /var/log/lxc/lxc-{{name}}.log --logpriority INFO -- --dist debian --release {{release}} --arch amd64"
|
||||||
when: container_exists.stdout_lines == []
|
when: container_exists.stdout_lines == []
|
||||||
|
|
||||||
#- name: Create container
|
#- name: Create container
|
||||||
|
@ -13,21 +13,25 @@
|
||||||
# name: "{{name}}"
|
# name: "{{name}}"
|
||||||
# container_log: true
|
# container_log: true
|
||||||
# template: download
|
# template: download
|
||||||
# state: stopped
|
# state: started
|
||||||
# template_options: "--release {{release}}"
|
# template_options: "--release {{release}}"
|
||||||
|
# when: container_exists.stdout_lines == []
|
||||||
|
|
||||||
- name: Disable network configuration inside container
|
- name: Disable network configuration inside container
|
||||||
replace:
|
replace:
|
||||||
name: "/var/lib/lxc/{{name}}/rootfs/etc/default/networking"
|
name: "/var/lib/lxc/{{name}}/rootfs/etc/default/networking"
|
||||||
regexp: "^#CONFIGURE_INTERFACES=yes"
|
regexp: "^#CONFIGURE_INTERFACES=yes"
|
||||||
replace: CONFIGURE_INTERFACES=no
|
replace: CONFIGURE_INTERFACES=no
|
||||||
when: lxc_network_type == "none"
|
when: lxc_net_0_type == "none"
|
||||||
|
|
||||||
- name: Disable interface shut down on halt inside container
|
- name: Disable interface shut down on halt inside container
|
||||||
lineinfile:
|
lineinfile:
|
||||||
name: "/var/lib/lxc/{{name}}/rootfs/etc/default/halt"
|
name: "/var/lib/lxc/{{name}}/rootfs/etc/default/halt"
|
||||||
line: "NETDOWN=no"
|
line: "NETDOWN=no"
|
||||||
when: lxc_network_type == "none" and release != "stretch"
|
when:
|
||||||
|
- lxc_net_0_type == "none"
|
||||||
|
- release != "stretch"
|
||||||
|
- release != "buster"
|
||||||
|
|
||||||
- name: Make the container poweroff on SIGPWR (sent by lxc-stop) on jessie
|
- name: Make the container poweroff on SIGPWR (sent by lxc-stop) on jessie
|
||||||
file:
|
file:
|
||||||
|
@ -49,7 +53,9 @@
|
||||||
name: "/var/lib/lxc/{{name}}/rootfs/etc/rc.local"
|
name: "/var/lib/lxc/{{name}}/rootfs/etc/rc.local"
|
||||||
line: "chmod 755 /dev"
|
line: "chmod 755 /dev"
|
||||||
insertbefore: "^exit 0$"
|
insertbefore: "^exit 0$"
|
||||||
when: release != 'stretch'
|
when:
|
||||||
|
- release != 'stretch'
|
||||||
|
- release != 'buster'
|
||||||
|
|
||||||
- name: Check if container is running
|
- name: Check if container is running
|
||||||
command: "lxc-ls --running {{name}}"
|
command: "lxc-ls --running {{name}}"
|
||||||
|
|
|
@ -7,7 +7,7 @@ lxc.id_map = g 0 100000 10000
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
# Set the default network virtualization method.
|
# Set the default network virtualization method.
|
||||||
lxc.network.type = {{lxc_network_type}}
|
lxc.net.0.type = {{lxc_net_0_type}}
|
||||||
|
|
||||||
{% if lxc_mount_part %}
|
{% if lxc_mount_part %}
|
||||||
# Mount {{lxc_mount_part}} into containers.
|
# Mount {{lxc_mount_part}} into containers.
|
||||||
|
@ -16,7 +16,7 @@ lxc.mount.entry = {{lxc_mount_part}} {{lxc_mount_part |replace('/', '')}} none b
|
||||||
{% endif %}
|
{% endif %}
|
||||||
# Only one tty is enough.
|
# Only one tty is enough.
|
||||||
# This require that you disabled others tty ([2-6]) in systemd.
|
# This require that you disabled others tty ([2-6]) in systemd.
|
||||||
lxc.tty = 1
|
lxc.tty.max = 1
|
||||||
|
|
||||||
# Run 64bits containers
|
# Run 64bits containers
|
||||||
lxc.arch = x86_64
|
lxc.arch = x86_64
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
- "templates/evoadmin-web/config.local.{{ inventory_hostname }}.php.j2"
|
- "templates/evoadmin-web/config.local.{{ inventory_hostname }}.php.j2"
|
||||||
- "templates/evoadmin-web/config.local.{{ host_group }}.php.j2"
|
- "templates/evoadmin-web/config.local.{{ host_group }}.php.j2"
|
||||||
- "templates/evoadmin-web/config.local.php.j2"
|
- "templates/evoadmin-web/config.local.php.j2"
|
||||||
- "config.local.conf.j2"
|
- "config.local.php.j2"
|
||||||
register: evoadmin_config_local_php_template
|
register: evoadmin_config_local_php_template
|
||||||
|
|
||||||
- name: Enable proxy_fcgi
|
- name: Enable proxy_fcgi
|
||||||
|
|
Loading…
Reference in a new issue