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

Wrong VHOST set on AWS ec2 #19

Closed
nielsonsantana opened this issue Jul 29, 2019 · 4 comments
Closed

Wrong VHOST set on AWS ec2 #19

nielsonsantana opened this issue Jul 29, 2019 · 4 comments

Comments

@nielsonsantana
Copy link

nielsonsantana commented Jul 29, 2019

I tried the fallowing ansible code to install dokku.

- import_role:
    name: dokku
  vars:
    dokku_key_file: /home/ubuntu/.ssh/authorized_keys
    dokku_hostname: mydomain.com
    dokku_version: 0.17.5
    dokku_plugins:
      - name: clone
        url: https://github.com/crisward/dokku-clone.git
# dependences
ansible==2.7.12
ansible-dokku==2019.4.3
python==3.7.3

Output

ubuntu@ip-172-30-1-86:/home/dokku$ cat HOSTNAME
mydomain.com
ubuntu@ip-172-30-1-86:/home/dokku$ cat VHOST
ip-172-30-1-86.sa-east-1.compute.internal

I think that the value for VHOST must be mydomain.com.

@josegonzalez
Copy link
Member

@michaelshobbs do you remember why we have both a HOSTNAME and VHOST? I swear we had this conversation once but don't have a link...

@isundaylee
Copy link
Contributor

I just ran into this issue today. I did a little digging. Currently ansible-dokku relies on the dpkg configuration routine to set VHOST and HOSTNAME. However:

  1. dpkg will only set VHOST if it doesn't exist: https://github.com/dokku/dokku/blob/dd7d1d2f8d153b634527efc2d32d761bcc26b9b6/debian/postinst#L125
  2. Earlier in the process, dpkg will set up the plugins. In particular, the 00_dokku-standard plugin will create the VHOST file if it doesn't exist by copying over the HOSTNAME file: https://github.com/dokku/dokku/blob/dd7d1d2f8d153b634527efc2d32d761bcc26b9b6/plugins/00_dokku-standard/install#L9
  3. As a result, dpkg will never set VHOST to the value we want.

Should we change dpkg-handling to always set VHOST regardless of whether it exists? This is what it currently does for HOSTNAME.

@josegonzalez
Copy link
Member

Yeah that makes sense to me.

@ltalirz
Copy link
Member

ltalirz commented Jul 16, 2020

Opened issue dokku/dokku#4065 on dokku for this.
PR #75 clearly demonstrates that the dokku_hostname variable works now, i.e. this issue can be closed.
Thanks @atnartur !

@ltalirz ltalirz closed this as completed Jul 16, 2020
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

No branches or pull requests

4 participants