-
Notifications
You must be signed in to change notification settings - Fork 5
Setup: Deploy with ansible
Holger Hees edited this page Feb 1, 2024
·
8 revisions
The initial described deployment is a staging deployment using vagrant, which runs inside a virtual machine.
If you want to use ansible directly or to deploy on your production system, you have to do the following steps.
- Install opensuse , almalinux (rhel) and ubuntu
- Install git and ansible (version >=4.10.0 which includes ansible-core version 2.11.12)
- On opensuse run
sudo zypper install git python3-netaddr python3-pip system-user-nobody
- On almalinux (rhel) run
sudo yum install git python python3-netaddr python3-pip
- On ubuntu run
sudo yum install git python3-netaddr python3-pip
- On all systems run
pip install ansible==4.10.0
- On opensuse run
- Clone this deployment project by running
git clone https://github.com/HolgerHees/smartserver.git
- Type
cd smartserver
to change into the<projectfolder>
- Copy your configuration folder into
<projectfolder>/config/<myserver>
, where<myserver>
is the name used in<projectfolder>/config/<myserver>/server.ini
. You can use rsync on linux or winscp on windows to copy this folder. - Configure your network with the same ip as defined in
<projectfolder>/config/<myserver>/env.yml
for the keyproduction_ip
orstaging_ip
- [OPTIONAL] Mount the partitions from the partition setup. If they not exists,
/smartserver
and/smartserver/data
are created as normal folders. - To start the deployment, run
sudo ansible-playbook -i config/<myserver>/server.ini server.yml
It will detect that it runs on a production system and installs services from this setup if necessary.
If you use an encrypted vault folder, you have to run:
sudo ansible-playbook -i config/<myserver>/server.ini --ask-vault-pass server.yml
If you want to apply only some ansible roles, you can restrict them by using the --tags
parameter. e.g. to apply only the nextcloud
role, run:
sudo ansible-playbook -i config/<myserver>/server.ini --tags "nextcloud" --ask-vault-pass server.yml
The differences between the staging and the production setup are explained here
- Home
- Motivation
- Main Features
- How to start
- Configuration
- Examples
- Special Roles