ansible-roles/lxc-php/tasks/misc.yml

39 lines
1.3 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
- name: "{{ lxc_php_version }} - Configure timezone for the container"
copy:
remote_src: yes
src: "/etc/timezone"
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/timezone"
- name: "{{ lxc_php_version }} - Ensure container's root directory is 755"
file:
path: "/var/lib/lxc/{{ lxc_php_version }}/rootfs"
state: directory
mode: '0755'
- name: "{{ lxc_php_version }} - Configure mailname for the container"
copy:
content: "{{ evolinux_hostname }}.{{ evolinux_domain }}\n"
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/mailname"
notify: "Restart opensmtpd"
- name: "{{ lxc_php_version }} - Install misc packages"
lxc_container:
name: "{{ lxc_php_version }}"
container_command: "DEBIAN_FRONTEND=noninteractive apt install -y cron logrotate git zip unzip"
- name: "{{ lxc_php_version }} - Add MySQL socket to container default mounts"
lxc_container:
name: "{{ lxc_php_version }}"
container_config:
- "lxc.mount.entry = /var/run/mysqld {{ php_conf_mysql_socket_dir | replace('/', '', 1) }} none bind,create=dir 0 0"
when: php_conf_mysql_socket_dir is string
register: added_mysql_socket
- name: "{{ lxc_php_version }} - Restart container as configuration changed"
lxc_container:
name: "{{ lxc_php_version }}"
state: restarted
when: added_mysql_socket.changed