HolgerHees / smartserver

SmartHome Server deployment setup
http://www.intranet-of-things.com/smarthome/infrastructure/server/setup/
GNU General Public License v3.0
26 stars 7 forks source link

Documentation question/suggestion #7

Closed imaginator closed 2 years ago

imaginator commented 2 years ago

I was using parts of the repo to help build my own system. But now I'd like to also use the staging/production mix and migrate my ansible roles into this.

It's not clear in https://github.com/HolgerHees/smartserver/wiki/Setup:-Create#create-your-own-setup how to:

Point 5: copying files is unclear - copy config/demo/ to the production server?

Perhaps an example where we:

  1. mention adding production ip to server.ini,
  2. run with (from laptop) ansible-playbook -i config/demo/server.ini --extra-vars "target=production" server.yml

At least this would be my thinking after playing around with your setup very briefly. I might be missing something so take all of this with a grain of salt.

HolgerHees commented 2 years ago

Hi,

thanks for your feedback.

I made some changes to the documentation. Is this now more helpful?

There is also no need for --extra-vars "target=production. The deployment detects the type of deployment automatically with the server ip. This means. If the server IP matches production_ip it will deploy the production setup. If the server IP matches staging_ip it will deploy the staging setup. This is more safe, because it prevents you from deploying staging on production :-)

imaginator commented 2 years ago

Thanks @HolgerHees. Am I correct to assume that you run with two copies of the repo:

Is there/would it make sense to just have one repo (on laptop) with the option to deploy to the remote server?

HolgerHees commented 2 years ago

Yes, this works too, if you modify the server.ini as described in my changed wiki page.

If you want to deploy local staging and remote production i would recommend to have two server.ini files like

server_local.ini and server_production.ini

imaginator commented 2 years ago

right - makes sense. I see you have most roles tagged so I'm not too worried about speed when just deploying using --tags. Thanks for the documentation updates.