Skip to content

Karandash8/unitedforu_ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SETUP

Please use Ubuntu 20.04 Focal as target host to make sure that everything runs smoothly.

Setting up local environment

python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip3 install ansible==4.6.0

Setting up vault

Create variables file:

export VAULT_FILE=roles/unitedforu-bot/vars/vault.yml

echo 'TELEGRAM_API_TOKEN: "<YOUR_TOKEN>"' > $VAULT_FILE
echo 'TELEGRAM_LIST_OF_ADMIN_IDS: "<COMMA_SEPARATED_LIST_OF_TELEGRAM_USER_IDS>"' >> $VAULT_FILE
echo 'STORE_SHEET_ID: "<YOUR_STORE_SHEET_ID>"' >> $VAULT_FILE
echo 'LOAD_SHEET_ID: "<YOUR_LOAD_SHEET_ID>"' >> $VAULT_FILE
echo 'SHEET_CREDENTIALS_PATH: "~/.service_account.json"' >> $VAULT_FILE

# How to get a Google service account file (https://developers.google.com/workspace/guides/get-started)
echo 'GOOGLE_APPLICATION_CREDENTIALS_FILE: <GOOGLE_SERVICE_ACCOUNT_JSON>' >> $VAULT_FILE

Encrypt file with Ansible vault

ansible-vault encrypt $VAULT_FILE

Create a file with Ansible vault password

echo '<YOUR_VAULT_PASSWORD>' > .password
chmod 600 .password

Setting up inventory

cp inventory.template inventory

then set HOST_IP in the inventory file as the target host IP.

OPERATIONS

Host configuration

ansible-playbook -i inventory --diff playbooks/preconfigration.yml

unitedforu-bot container

Deployment

ansible-playbook -i inventory --diff playbooks/unitedforu.yml

Change to a specific state

ansible-playbook -i inventory --diff playbooks/unitedforu.yml -e container_state=<STATE>

Available stated:

  • absent
  • present
  • started
  • stopped

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages