Configuring and Deploying bedrock-ansible & Bedrock in Windows

Hi,
For some reason I’m getting a blank page on my Vagrant config.
I first tried to create a second host on a working VM but had no success. As a result I have created a second Bedrock-Ansible instance in another folder. The VM boots OK without any errors, but for some reason it keeps giving me a blank page rejecting my connection.
The instructions that I’ve followed are:

  • Cloned Bedrock-ansible git repository and modified the development file in group_vars so that:

    mysql_root_password: devpw

    wordpress_sites:
    - site_name: rpe.dev
    site_hosts:
    - rpe.dev
    local_path: ‘…/rpe.dev’ # path targeting local project directory (relative to root/Vagrantfile)
    user: vagrant
    group: www-data
    site_install: true
    site_title: RPE Site
    admin_user: admin
    admin_password: admin
    admin_email: admin@rpe.dev
    system_cron: true
    multisite:
    enabled: false
    env:
    wp_home: http://rpe.dev
    wp_siteurl: http://rpe.dev/wp
    wp_env: development
    db_name: rpe_name
    db_user: rpe_user
    db_password: rpe_password

    php_error_reporting: 'E_ALL’
    php_display_errors: 'On’
    php_display_startup_errors: 'On’
    php_track_errors: 'On’
    php_mysqlnd_collect_memory_statistics: 'On’
    php_opcache_enable: 0

*Ran composer create-project roots/bedrock rpe.dev and edited my .env file:

DB_NAME=rpe_name
DB_USER=rpe_user
DB_PASSWORD=rpe_password
DB_HOST=localhost

WP_ENV=development
WP_HOME=http://rpe.dev
WP_SITEURL=http://rpe.dev/wp
AUTH_KEY=my key
SECURE_AUTH_KEY=my key
LOGGED_IN_KEY=my key
NONCE_KEY=my key
AUTH_SALT=my key
SECURE_AUTH_SALT=my key
LOGGED_IN_SALT=my key
NONCE_SALT=my key
  • Cloned in the app directory the roots theme and done a npm install.

After doing a vagrant up there is no prompt to install wordpress or any sign that the webserver is listening to the connection.

I have tried checking the nginx log but vagrant tells me I don’t have enough permissions.

Any help would be much appreciated

After a day of chasing my tail I finally got it to work.

Let me first clarify that I’m running windows.

MAKE SURE THAT YOU HAVE RUBY INSTALLED

This is what I’ve done to make it work (The info is all there, unfortunately is a bit scattered).

1.Create a directory to hold your website (In my case rpe). And run:

git clone https://github.com/roots/bedrock-ansible.git

2.Copy the windows.sh file and overwrite the Vagrant file with these files

3.Go to C:\Windows\System32\drivers\etc and open it with notepad with administrative privileges. Create an entry for your hosts. In my case it was:

192.168.50.5  rpe.dev

4.Modify your Vagrant file so that config.vm.synced_folder points to the bedrock project name, in my case rpe.dev:

  config.vm.network :private_network, ip: '192.168.50.5'
  config.vm.hostname = 'rpe.dev'

  # adjust paths relative to Vagrantfile
  config.vm.synced_folder '../rpe.dev', '/srv/www/rpe.dev/current',
            id: 'current',
            owner: 'vagrant',
            group: 'www-data',
            mount_options: ['dmode=776', 'fmode=775']

5.Also in Vagranfile make sure that sh.args has the developer slash:

sh.args = "site.yml hosts/development"

6.In the same directory as bedrock-ansible run :

composer create-project roots/bedrock rpe.dev

As I wanted to my project to be called rpe.dev.
Make sure that both bedrock-ansible and your project (in my case rpe.dev) are on the same level. In my case:

-rpe
  | -bedrock-ansible
  | -rpe.dev

7.Open the development file under bedrock-ansible/group_vars and change all the variables so that they suit your setup. In my case my development file looks like this:

mysql_root_password: devpw

wordpress_sites:
  - site_name: rpe.dev
    site_hosts:
      - rpe.dev
    local_path: '../rpe.dev' # path targeting local project directory (relative to root/Vagrantfile)
    user: vagrant
    group: www-data
    site_install: true
    site_title: rpe Site
    admin_user: admin
    admin_password: admin
    admin_email: admin@rpe.dev
    system_cron: true
    multisite:
      enabled: false
    env:
      wp_home: http://rpe.dev
      wp_siteurl: http://rpe.dev/wp
      wp_env: development
      db_name: rpe_dev
      db_user: rpe_dbuser
      db_password: rpe_dbpassword

php_error_reporting: 'E_ALL'
php_display_errors: 'On'
php_display_startup_errors: 'On'
php_track_errors: 'On'
php_mysqlnd_collect_memory_statistics: 'On'
php_opcache_enable: 0

Be aware that this is a development site which I run locally; so security is very lax. For deployment with capistrano (which I don’t use) the important file is the production file in that same directory.

At this point in windows you have to run - this first time only:

vagrant up

in the bedrock-ansible directory with administrator privileges, otherwise it will error out, and you’ll have to rebuild the vagrant instance.

After running succesfully go to the your web/app/themes directory and install roots starter theme with:

  git clone  https://github.com/roots/roots.git

In my case the directory is: D:\rpe\rpe.dev\web\app\themes

Hope this helps :slight_smile:

3 Likes

Glad you got it figured out! :+1:

Hey man,

Thanks for putting together the instructions. I followed everything and got pretty far. I’m running into a weird issue when I go to “http://mysite.dev”. I get the following console error: Uncaught SyntaxError: Unexpected token <

Did you experience this?

Thanks,
Jason

That’s just a JavaScript error. Shouldn’t really have anything to do with Bedrock or Ansible. But we don’t have much to go on.