Conversation
| sudo: yes | ||
| service: name=apache2 state=restarted enabled=yes | ||
|
|
||
| - name: Ensure apache is reloaded |
There was a problem hiding this comment.
Why are you reloading when it's restarted just above?
There was a problem hiding this comment.
because apache2 is fickle :P
|
What's the status on this? |
|
@thatarchguy you were supposed to have Vagrant run without ansible needing to be installed on the host system. |
|
@PrahlM93 Yeah...check the last commit... |
|
Looks good. I can't test it until next Monday cause I'm in France until Sunday evening. If you're confident in it, we can merge. Otherwise we can wait for when I get back. |
|
Enjoy your vacation :D |
Vagrantfile
Outdated
| '--extra-vars="remote_user=vagrant"', | ||
| '--extra-vars="provision_type=dev"' | ||
| ] | ||
| # I don't know why, but extra_vars doesn't work with ansible_local |
There was a problem hiding this comment.
Can we omit the one on line 34 then?
There was a problem hiding this comment.
ansible.extra_vars is the proper way to do it for vagrant. The problem is that doesn't work for the ansible-local provisioner for some reason, which is what I converted it to use. The raw_arguments is a workaround. I don't like it, which is why I left both it in there. Having both still works with either ansible-local or ansible provisioner.
ansible-local or ansible provisioner.
|
@thatarchguy, I'm getting an Internal Server Error when running this via Vagrant. I'll have to look later to see what's causing it. |
|
@thatarchguy, I fixed the internal server error by removing the current migration scripts if present when in the dev provisioning type. I also had an issue destroying the VM since I didn't have ansible installed on my client. I fixed that by entirely running ansible on the guest through a shell script. I also fixed some deprecation warnings on sudo. Check out the commit and let me know what you think. |
| @@ -0,0 +1,3 @@ | |||
| --- | |||
| remote_user: "ubuntu" | |||
There was a problem hiding this comment.
This is defaulting to a non-existent user by default. How will ansible run a resource that uses this as an argument when ansible is being run by a package where you can't pass arguments?
There was a problem hiding this comment.
Should we have a step in the ansible playbook create a user defined by that variable and go from there? That's doable.
There was a problem hiding this comment.
Yeah, that's an idea. Like create a PostMaster user?
What other options are there? Can we just use built-in users instead?
Errrr you shouldn't need ansible on your host at all. It was also being installed into the guest by vagrant automagically. https://www.vagrantup.com/docs/provisioning/ansible_local.html The reason I still used |
Added travis fpm build and deploy to bintray Signed-off-by: Kevin <kevin@stealsyour.pw>
* Stops using ansible provisioner and runs ansible entirely on the guest using Vagrant * Fixes issue where migration scripts were still present causing the database to not be created * Replaces sudo with becomes to avoid deprecation warnings
ed42ac2 to
d67702a
Compare
Creates PostMaster service account user for file ownership Signed-off-by: Kevin <kevin@stealsyour.pw>
df63a97 to
a620637
Compare
|
@thatarchguy, LGTM |
A lot going on here.
We convert the install to use Ansible instead of the bash script. This works on Vagrant and any vanilla ubuntu server. For Vagrant I have the Vagrantfile pass a provision_type that is checked to determine whether or not to install and migrate mysql.
The build_release.sh script uses fpm to create a .deb package. I manually set the depends in the deb because you cannot install packages inside of installing a package in dpkg. I didn't want to shuffle lockfiles around, so this was a natural workaround.
If you installed the package using dpkg, you have to make sure you have those depends installed manually. You can work around this by using gdebi-core or by hosting the deb in an apt repo...
... I'm looking at bintray. You can then add our apt repo using
and just
apt-get install postmasterballing right? I just have to setup travis-ci to build the deb package and upload to bintray. I wanted to pass that by you first. Bintray can also host our docker containers and many many more.
one caveat? You need to install ansible on the target using pip, since ubuntu's ansible version is way out of date. This will be irrelevant when Ubuntu 16.04 is released this month