Browse Source

Upgrade ansible config

(cherry picked from commit e8a1a28)
experimental
Paweł Jedwabny 3 years ago
parent
commit
f89a0a1bcb
2 changed files with 16 additions and 3 deletions
  1. +8
    -1
      Vagrantfile
  2. +8
    -2
      playbook.yml

+ 8
- 1
Vagrantfile View File

@@ -44,7 +44,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 ".", "/var/www/html", owner: "www-data", group: "www-data"
config.vm.synced_folder ".", "/var/www/epesi", owner: "www-data", group: "www-data"
config.vm.synced_folder ".", "/vagrant"

# Provider-specific configuration so you can fine-tune various
@@ -72,5 +72,12 @@ Vagrant.configure("2") do |config|

config.vm.provision "ansible_local" do |ansible|
ansible.playbook = "playbook.yml"
ansible.compatibility_mode = "2.0"
end

config.vm.provision "shell", privileged: false, inline: <<-EOF
echo "Congratulations! Vagrant machine is provisioned!"
echo "Now setup Your Epesi http://$(facter -p ipaddress_eth1)"
echo "Database credentials: admin:$(cat /vagrant/mysqlpassword)"
EOF
end

+ 8
- 2
playbook.yml View File

@@ -5,7 +5,7 @@
repo: 'ppa:ondrej/php'
- apt:
update_cache: yes
- apt: name={{item}} state=installed
- apt: name={{item}} state=present
with_items:
- apache2
- php5.6
@@ -17,11 +17,17 @@
- php5.6-gd
- php5.6-intl
- php5.6-curl
- php5.6-zip
- mysql-server
- python-mysqldb
- lineinfile:
path: '/etc/apache2/sites-available/000-default.conf'
regexp: 'DocumentRoot'
line: ' DocumentRoot /var/www/epesi'
- service: name=apache2 state=restarted
- mysql_db: name=epesi state=present
- mysql_user:
name: admin
password: 1234
password: "{{ lookup('password', './mysqlpassword length=8') }}"
priv: 'epesi.*:ALL,GRANT'
state: present

Loading…
Cancel
Save