Ver código fonte

Various

merge-requests/1/merge
Christoph Haas 6 anos atrás
pai
commit
4a7afbc3f3
4 arquivos alterados com 24 adições e 9 exclusões
  1. +5
    -6
      Vagrantfile
  2. +6
    -0
      ansible/ansible.cfg
  3. +13
    -3
      ansible/roles/ispmail-database/tasks/main.yml
  4. +0
    -0
      ansible/roles/ispmail-database/templates/root-my-cnf.j2

+ 5
- 6
Vagrantfile Ver arquivo

@@ -13,7 +13,7 @@ Vagrant.configure(2) do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
#config.vm.box = "jessie64"
config.vm.box = "debian/stretch64"
config.vm.box = "debian/buster64"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
@@ -39,7 +39,7 @@ Vagrant.configure(2) do |config|
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
config.vm.synced_folder "ansible", "/root"
#config.vm.synced_folder "ansible", "/root"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
@@ -73,11 +73,10 @@ Vagrant.configure(2) do |config|

config.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/ispmail.yml"
ansible.sudo = true
#ansible.become = true
ansible.become = true
#ansible.become_user = 'root'
#ansible.compatibility_mode = '2.0'
#ansible.verbose = 'vvv'
ansible.compatibility_mode = '2.0'
##ansible.verbose = 'vvv'
end

config.vm.provider "virtualbox" do |vb|


+ 6
- 0
ansible/ansible.cfg Ver arquivo

@@ -28,3 +28,9 @@ roles_path = ansible/roles
[ssh_connection]
# Speed improvement, but may break sudo with requiretty
pipelining = True

[privilege_escalation]
become=True
become_method=sudo
become_user=root
become_ask_pass=False

+ 13
- 3
ansible/roles/ispmail-database/tasks/main.yml Ver arquivo

@@ -1,10 +1,20 @@
---
- name: Installing required Python mysqldb module for Ansible to manage databases
apt: name=python-pymysql
# - name: Creating my-cnf for root user
# template: src=root-my-cnf.j2 dest=/root/.my.cnf mode=0600
- name: Ensure mysql root password is updated for all root accounts
mysql_user:
name: root
host: localhost
login_unix_socket: /var/run/mysqld/mysqld.sock
password: "{{ ispmail_mysql_root_password }}"
priv: '*.*:ALL,GRANT'
check_implicit_admin: true
#become: yes
#notify: Restart MySQL
- name: Creating my-cnf for root user
template: src=root-my-cnf.j2 dest=/root/.my.cnf mode=0600
- name: creating mailserver MySQL database
mysql_db: name=mailserver
mysql_db: name=mailserver login_password="{{ ispmail_mysql_root_password }}"
- name: creating Roundcube MySQL database
mysql_db: name=roundcube
- name: copying MySQL database schema to server


ansible/roles/ispmail-database/templates/my-cnf.j2 → ansible/roles/ispmail-database/templates/root-my-cnf.j2 Ver arquivo


Carregando…
Cancelar
Salvar