carlalexander / debops-wordpress

Your superpowered WordPress server in three commands.
GNU General Public License v3.0
440 stars 65 forks source link

TASK [debops.pki : Download public realm contents by host] Fails #215

Open isaiaholoyede opened 5 years ago

isaiaholoyede commented 5 years ago

By the way, great job on this playbook! This is not the first time I will be using this playbook. I just pulled the latest release, but I cannot get the playbook to go past that particular task. I believe that I have things setup correctly.

On close inspection, I noticed that the task is referring to a non-existent directory in the secret folder: secret/pki/realms/by-host/genesis.rccgla.org/rccgla.org/external/

This directory exists instead: secret/pki/realms/by-host/genesis.rccgla.org/domain/external/

Could you point me in the right direction of what I must have done wrong?

TASK [debops.pki : Download public realm contents by host] ***********************************************************************************************************
ok: [genesis.rccgla.org] => (item=[{'name': 'domain', 'acme': False, 'default_subdomains': ['genesis', '*.genesis', '_wildcard_']}, 'external'])
ok: [genesis.rccgla.org] => (item=[{'name': 'domain', 'acme': False, 'default_subdomains': ['genesis', '*.genesis', '_wildcard_']}, 'internal'])
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: If you are using a module and expect the file to exist on the remote, see the remote_src option
failed: [genesis.rccgla.org] (item=[{'name': 'rccgla.org', 'acme': True, 'acme_challenge_dir': '/var/www/acme/.well-known/acme-challenge', 'acme_default_subdomains': ['www'], 'acme_subdomains': ['www'], 'default_subdomains': ['www'], 'subdomains': ['www']}, 'external']) => {"changed": false, "item": [{"acme": true, "acme_challenge_dir": "/var/www/acme/.well-known/acme-challenge", "acme_default_subdomains": ["www"], "acme_subdomains": ["www"], "default_subdomains": ["www"], "name": "rccgla.org", "subdomains": ["www"]}, "external"], "msg": "Could not find or access '/Users/isaiaholoyede/Personal/Websites/setup/rccgla.org/inventory/../secret/pki/realms/by-host/genesis.rccgla.org/rccgla.org/external/' on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option"}
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: If you are using a module and expect the file to exist on the remote, see the remote_src option
failed: [genesis.rccgla.org] (item=[{'name': 'rccgla.org', 'acme': True, 'acme_challenge_dir': '/var/www/acme/.well-known/acme-challenge', 'acme_default_subdomains': ['www'], 'acme_subdomains': ['www'], 'default_subdomains': ['www'], 'subdomains': ['www']}, 'internal']) => {"changed": false, "item": [{"acme": true, "acme_challenge_dir": "/var/www/acme/.well-known/acme-challenge", "acme_default_subdomains": ["www"], "acme_subdomains": ["www"], "default_subdomains": ["www"], "name": "rccgla.org", "subdomains": ["www"]}, "internal"], "msg": "Could not find or access '/Users/isaiaholoyede/Personal/Websites/setup/rccgla.org/inventory/../secret/pki/realms/by-host/genesis.rccgla.org/rccgla.org/internal/' on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option"}
    to retry, use: --limit @/Users/isaiaholoyede/Personal/Websites/setup/rccgla.org/playbooks/wordpress.retry

PLAY RECAP ***********************************************************************************************************************************************************
genesis.rccgla.org         : ok=190  changed=0    unreachable=0    failed=1
carlalexander commented 5 years ago

What version of the project are you using? When did you run debops-update last? I just did a new release last week because a lot changed with DebOps in the last 6 months so it's possible that that's the issue.

isaiaholoyede commented 5 years ago

I am running the latest version. I cleaned out my old project and I did debops-update before running it. I also refreshed my DO droplet a second time and re-ran the project just in case I missed a step, and I still got the same error at the same point.

Let me reclone and try it one more time, starting from scratch again. Will let you know.

isaiaholoyede commented 5 years ago

I am running the latest version. I cleaned out my old project and I did debops-update before running it. I also refreshed my DO droplet a second time and re-ran the project just in case I missed a step, and I still got the same error at the same point.

Let me reclone and try it one more time, starting from scratch again. Will let you know.

Same problem at the same place - I did everything from scratch.

carlalexander commented 5 years ago

Can you show me the config that you're using? (Sorry, I should have asked that earlier.)

isaiaholoyede commented 5 years ago

This is what I have:

# .debops.cfg
# DebOps configuration file
# Nothing added here
# hosts
[debops_all_hosts]
genesis.rccgla.org ansible_python_interpreter=/usr/bin/python3

[wordpress]
genesis.rccgla.org
---
# inventory/host_vars/genesis.rccgla.org/vars.yml

wordpress__admin_email: 'xxxx@rccgla.org'
wordpress__admin_username: 'xxxxx'
wordpress__title: 'Light Assembly'
wordpress__domain: 'rccgla.org'
wordpress__table_prefix: 'xxxx_wp_'
wordpress__disable_file_edit: True
wordpress__ssl: True
wordpress__ssl_provider: 'letsencrypt' # Default, not necessary.
wordpress__plugins:
  - name: 'google-analytics-dashboard-for-wp'
  - name: 'safe-redirect-manager'     
  - name: 'elasticpress'
  - name: 'redis-cache'
  - name: 'wordpress-seo'
  - name: 'tiny-compress-images'
  - name: 'varnish-http-purge'
wordpress__varnish__add_ban_lurker_headers: True
wordpress__varnish__purge_conditions:
  'req.http.X-Purge-Method ~ "(?i)regex"': |
    ban("obj.http.X-Url ~ " + req.url + " && obj.http.X-Host == " + req.http.host);
    return (synth(200, "Purged"));
carlalexander commented 5 years ago

Let me check things and get back to you. I have a feeling that if you create the secret/pki/realms/by-host/genesis.rccgla.org/rccgla.org/external/ directory manually it'll work. But I'd like to see why it's not created automatically. I might have missed some dependency.

isaiaholoyede commented 5 years ago

ok.. let me create manually then... I compared your code from the previous version to the new one.. I noticed that instead of wordpress__pki__host_realms, you now use wordpress__pki__dependent_realms, could it be the culprit?

carlalexander commented 5 years ago

Nah, that's a change from the new version of DebOps. Everything needs to go through dependent_ variables.

carlalexander commented 5 years ago

Did it fix the issue @isaiaholoyede?

isaiaholoyede commented 5 years ago

Did it fix the issue @isaiaholoyede?

Yes, manually creating the folders fixed the issue. Sorry that I did not get back to you. I had to manually create the folders for internal, external, and private. Creating external alone still caused it to fail.

carlalexander commented 5 years ago

Ok, I'll try to figure out why that's happening with @drybjed

isaiaholoyede commented 5 years ago

Also, I had to add apt__cache_valid_time: 0 as part of vars.yml because it fails to find the source repo for redis for some weird reason No package matching 'redis-server' is available - not sure whether it is peculiar to me or it is general.