Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wordpress_sites improvements #528

Merged
merged 1 commit into from
Mar 25, 2016
Merged

Conversation

swalkinshaw
Copy link
Member

  • Add to_env filter
  • Use combine + to_env for better .env templates
  • Remove the need for wp_env and set automatically based on env
  • Set disable_wp_cron by default

@swalkinshaw swalkinshaw force-pushed the set-wp-env-automatically branch 2 times, most recently from 94ba0fa to 1010012 Compare March 25, 2016 18:59
@swalkinshaw
Copy link
Member Author

Some doc updates should accompany this.

* Add to_env filter
* Use combine + to_env for better .env templates
* Remove the need for wp_env and set automatically based on env
* Set disable_wp_cron by default
@swalkinshaw swalkinshaw force-pushed the set-wp-env-automatically branch from 1010012 to c017338 Compare March 25, 2016 19:20
@swalkinshaw swalkinshaw merged commit 76cad9d into master Mar 25, 2016
@swalkinshaw swalkinshaw deleted the set-wp-env-automatically branch March 25, 2016 20:41
@henkler
Copy link
Contributor

henkler commented Mar 26, 2016

I think there may be an issue here with 'roles/deploy/templates/env.j2'. Getting a failure on deploy.

failed: [staging.example.com] => (item={u'dest': u'.env', u'src': u'roles/deploy/templates/env.j2', u'name': u'.env config'}) => {"failed": true, "item": {"dest": ".env", "name": ".env config", "src": "roles/deploy/templates/env.j2"}, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'value'"}

@henkler
Copy link
Contributor

henkler commented Mar 26, 2016

Maybe this instead for env.j2?

{{ wordpress_env_defaults | combine(wordpress_sites[site].env, vault_wordpress_sites[site].env) | to_env }}

@vdrnn
Copy link

vdrnn commented Mar 26, 2016

Yep, ran into the exact same issue after updating an existing installation.
It goes through with @henkler's proposition {{ wordpress_env_defaults | combine(wordpress_sites[site].env, vault_wordpress_sites[site].env) | to_env }}

@fullyint
Copy link
Contributor

Thank you @henkler for helping catch that this env.j2 template in the deploy role must be different from the env.j2 template in the wordpress-install role.

Your edit works. There is a bit of convention in the deploy role to prefer using the project dict, which is only slightly different:

{{ wordpress_env_defaults | combine(project.env, vault_wordpress_sites[site].env) | to_env }}

@fullyint
Copy link
Contributor

@henkler Would you be interested in submitting a pull request for this?

@henkler
Copy link
Contributor

henkler commented Mar 26, 2016

Sure. Let me run another deploy first and I'll get it submitted.

@henkler
Copy link
Contributor

henkler commented Mar 26, 2016

PR #530 submitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants