Commit f4c31e6a by Szeberényi Imre

Merge branch 'master' of https://git.ik.bme.hu/CIRCLE3/salt

parents d9b501ff d11ab984
...@@ -3,139 +3,54 @@ ...@@ -3,139 +3,54 @@
## OS Support ## OS Support
* Red Hat Linux family: * Red Hat Linux family:
* Red Hat Enterprise Linux 7+ * under development
* Cent OS 7+
* Scientific Linux 7+
* Debian Linux family: * Debian Linux family:
* Debian linux 8+ * Ubuntu linux 18.04 LTS
* Ubuntu linux 14.04 LTS
## Prerequisites ## Prerequisites
### Red Hat family ### Red Hat family
Install EPEL repository (if the link is broken, please contact us): TBD
```bash
sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
```
Install some important packages:
```bash
sudo yum install python2-pip gcc vim git
```
### Debian family ### Debian family
Install some important packages: For Devenv start a new ubuntu 18.04 with least 4G RAM.
```bash Set the proper hostname.
sudo apt-get update
sudo apt-get install python-pip vim git
```
## Install Salt
In circle VMs you can set the name to mycircel-dev using the following commands.
```bash ```bash
sudo pip install salt==2014.7.1 sudo sed -ie 1,\$s/$(hostname)/mycircle-dev/ /etc/hosts
sudo bash -c "echo mycircle-dev > /etc/hostname"
sudo reboot - it not neccessary because the next steps
``` ```
## Get the installer Refresh your system:
Clone circle installer git repository into cloud home
```bash ```bash
git clone https://git.ik.bme.hu/circle/salt.git sudo apt update && sudo apt upgrade -y
sudo reboot
``` ```
## Change variables Install some important packages
Modify installer.sls file ```bash
``` sudo apt install python3 python3-pip python3-dev virtualenvwrapper git vim -y
vim salt/pillar/installer.sls
``` ```
Most used variables ## Get the installer
------------------- Clone circle installer git repository into cloud home
* **proxy_secret**: This is used to provide cryptographic signing, and should be set to a unique, unpredictable value.
* **secret_key**: This is used to provide cryptographic signing, and should be set to a unique, unpredictable value.
* **deployment_type**: local (development) or production
* **admin_user**: user name to login in as admin on the site
* **admin_pass**: password to login in as admin on the site
* **database**:
* **password**: database user’s password
* **amqp**:
* **password**: amqp user’s password
* **host**: amqp server IP - usually runs at localhost
* **graphite**:
* **password**: graphite user’s password
* **host**: graphite server IP - usually runs at localhost
* **nfs**:
* **enabled**: nfs is enabled
* **server**: nfs server’s hostname
* **network**: nfs server’s network to access files
* **directory**: this directory will be shared
* **storagedriver**:
* **queue_name**: the server’s hostname
* **fwdriver**:
* **queue_name**: the server’s hostname
* **gateway**: the server’s gateway
* **external_net**: the server’s network
* **external_if**: the server’s network interface
Other variables
---------------
* user: user who will install the software
* time zone: the server’s time zone, format is region/city
* amqp:
* user: amqp user
* port: amqp server’s port
* vhost: virtual host - specifies the namespace for entities (exchanges and queues) referred to by the protocol
* agent:
* repo_revision: revision
* agentdriver:
* repo_revision: revision
* cache: cache url - usually pylibmc://127.0.0.1:11211/
* database:
* name: django database’s name
* user: database user
* fwdriver:
* repo_revision: revision
* user: fwdriver user name
* vm_if: vm interface
* vm_et: vm network
* management_if: management interface
* reload_firewall_timeout: timeout for synchronous firewall reload
* graphite:
* user: graphite user
* port: graphite server’s port
* secret_key: graphite’s secret key
* manager:
* repo_revision: revision
* monitor-client:
* repo_revision: revision
* storage-driver:
* repo_revision: revision
* vm-driver:
* repo_revision: revision
* vnc-driver:
* repo_revision: revision
## Install Circle
Run the following installation command:
```bash ```bash
sudo salt-call state.sls allinone --local --file-root=/home/$USER/salt/salt --pillar-root=/home/$USER/salt/pillar git clone https://git.ik.bme.hu/CIRCLE3/salt.git
``` ```
After this finished, you have to get "Failed: 0" message.
If installer fails, please visit the [Troubleshooting](#troubleshooting) paragraph.
After install, delete agent.conf or agent.service file:
If you have upstart: ## Single node quick install
```bash ```bash
sudo rm -f /etc/init/agent.conf sudo salt/install --local [--defpass]
``` ```
Or if you have systemd:
```bash Open the port 443 for the portal
sudo rm -f /etc/systemd/system/agent.service ```bash
ufw allow 443
``` ```
## Quickstart - Standalone Node ## Quickstart - Standalone Node
......
...@@ -2,29 +2,29 @@ admin_pass: Dejo12Cuccos ...@@ -2,29 +2,29 @@ admin_pass: Dejo12Cuccos
admin_user: admin admin_user: admin
amqp: amqp:
host: 127.0.0.1 host: 127.0.0.1
password: 3U8pKWMrXwvTl0By password: dbtNFSc6OoinjM5e
port: 5672 port: 5672
user: cloud user: cloud
vhost: circle vhost: circle
cache: pylibmc://127.0.0.1:11211/ cache: pylibmc://127.0.0.1:11211/
database: database:
name: circle name: circle
password: 5073G0NlRCfHtXhc password: jgdxM2FGEAS0HRBb
user: circle user: circle
deployment_type: local deployment_type: local
fwdriver: fwdriver:
external_if: enp5s0f1 external_if: eth0
external_net: 10.4.0.204/16 external_net: 10.34.0.108/16
gateway: 10.4.255.254 gateway: 10.34.255.254
management_if: ethy management_if: ethy
queue_name: wombat queue_name: cloud-17198
trunk_if: linkb trunk_if: linkb
graphite: graphite:
host: 127.0.0.1 host: 127.0.0.1
password: jObTZWyvd7zioM1u password: z9qeb74Go2hHgByL
port: 5672 port: 5672
queue: monitor queue: monitor
secret_key: 17Z0LiChQm5lqUfe secret_key: R5NlO0KUprq1Z297
user: monitor user: monitor
vhost: monitor vhost: monitor
init_type: systemd init_type: systemd
...@@ -33,11 +33,11 @@ nfs: ...@@ -33,11 +33,11 @@ nfs:
enabled: true enabled: true
network: 127.0.0.0/8 network: 127.0.0.0/8
server: 127.0.0.1 server: 127.0.0.1
proxy_secret: r9l2JkQ6YIo4KNgf proxy_secret: 1FfsO9LbWTlagdVG
secret_key: M4mF9OcrKQwx6Sgq secret_key: EC0xuaGiMSY9VhAe
storagedriver: storagedriver:
queue_name: wombat queue_name: cloud-17198
timezone: Etc/UTC timezone: Europe/Budapest
user: cloud user: cloud
vmdriver: vmdriver:
hypervisor_type: kvm hypervisor_type: qemu
...@@ -17,6 +17,16 @@ requirement0: ...@@ -17,6 +17,16 @@ requirement0:
- require: - require:
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
requirement1:
file.managed:
- name: /home/{{ pillar['graphite']['user'] }}/requirement1.txt
- template: jinja
- source: salt://graphite/files/requirement1.txt
- user: {{ pillar['graphite']['user'] }}
- group: {{ pillar['graphite']['user'] }}
- require:
- user: {{ pillar['graphite']['user'] }}
requirements: requirements:
file.managed: file.managed:
- name: /home/{{ pillar['graphite']['user'] }}/requirements.txt - name: /home/{{ pillar['graphite']['user'] }}/requirements.txt
......
...@@ -6,8 +6,8 @@ After=network.target ...@@ -6,8 +6,8 @@ After=network.target
User={{ pillar['graphite']['user'] }} User={{ pillar['graphite']['user'] }}
Group={{ pillar['graphite']['user'] }} Group={{ pillar['graphite']['user'] }}
Environment=PYTHONPATH=/opt/graphite/lib GRAPHITE_ROOT=/opt/graphite Environment=PYTHONPATH=/opt/graphite/lib GRAPHITE_ROOT=/opt/graphite
WorkingDirectory=/opt/graphite/bin/ WorkingDirectory=/home/{{ pillar['graphite']['user'] }}
ExecStart=/bin/bash -c "source /etc/profile; workon graphite; exec twistd --nodaemon --reactor=epoll --no_save carbon-cache" ExecStart=/bin/bash -c "source /etc/profile; workon graphite; cd /opt/graphite/bin/; exec twistd --nodaemon --reactor=epoll --no_save carbon-cache"
Restart=always Restart=always
[Install] [Install]
......
# #
--no-binary=:all: -r requirements.txt --no-binary=:all: -r requirement1.txt
#
graphite-web
whisper
carbon
python-memcached python-memcached
whisper @ https://github.com/graphite-project/whisper/tarball/master
carbon @ https://github.com/graphite-project/carbon/tarball/master
graphite-web @ https://github.com/graphite-project/graphite-web/tarball/master
Django == 3.0.14 Django == 3.0.14
Twisted == 22.4.0 Twisted == 22.4.0
txAMQP txAMQP
......
...@@ -2,15 +2,31 @@ virtualenv_graphite: ...@@ -2,15 +2,31 @@ virtualenv_graphite:
virtualenv.managed: virtualenv.managed:
- python: /usr/bin/python3 - python: /usr/bin/python3
- name: /home/{{ pillar['graphite']['user'] }}/.virtualenvs/graphite - name: /home/{{ pillar['graphite']['user'] }}/.virtualenvs/graphite
- requirements: /home/{{ pillar['graphite']['user'] }}/requirement0.txt - requirements: /home/{{ pillar['graphite']['user'] }}/requirements.txt
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
- cwd: /home/{{ pillar['graphite']['user'] }} - cwd: /home/{{ pillar['graphite']['user'] }}
- no_chown: true - no_chown: true
- require:
- user: {{ pillar['graphite']['user'] }}
- file: /home/{{ pillar['graphite']['user'] }}/requirements.txt
- file: /opt/graphite
virtualenv_graphite_web:
virtualenv.managed:
- python: /usr/bin/python3
- name: /home/{{ pillar['graphite']['user'] }}/.virtualenvs/graphite
- requirements: /home/{{ pillar['graphite']['user'] }}/requirement0.txt
- user: {{ pillar['graphite']['user'] }}
- cwd: /home/{{ pillar['graphite']['user'] }}
- no_chown: true
- no_binary: all - no_binary: all
- env_vars:
PYTHONIOENCODING: 'utf-8'
- require: - require:
- virtualenv: virtualenv_graphite
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
- file: /home/{{ pillar['graphite']['user'] }}/requirement0.txt - file: /home/{{ pillar['graphite']['user'] }}/requirement0.txt
- file: /home/{{ pillar['graphite']['user'] }}/requirements.txt - file: /home/{{ pillar['graphite']['user'] }}/requirement1.txt
- file: /opt/graphite - file: /opt/graphite
global-site-packages: global-site-packages:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment