Commit 2562b0f6 authored by Aleksey Shirokih's avatar Aleksey Shirokih
Browse files

Merge branch 'master' into 'py3'

# Conflicts:
#   requirements.txt
parents b83324eb c3d54953
Pipeline #22991 passed with stages
in 3 minutes and 20 seconds
[bumpversion] [bumpversion]
current_version = 0.4.7 current_version = 0.4.8
commit = False commit = False
tag = False tag = False
serialize = {major}.{minor}.{patch} serialize = {major}.{minor}.{patch}
......
## Future ## 0.4.8 (2020-03-XX)
### Release Notes ### Release Notes
* Fix pool edit
* Fix Default node type
* Fix YAML warning
* Bump ansible to 2.9.6
## 0.4.7 (2019-12-03) ## 0.4.7 (2019-12-03)
### Release Notes ### Release Notes
......
...@@ -10,10 +10,10 @@ NOC (http://nocproject.org/) installations. ...@@ -10,10 +10,10 @@ NOC (http://nocproject.org/) installations.
- Ubuntu 16 LTS - Ubuntu 16 LTS
- Ubuntu 18 LTS - Ubuntu 18 LTS
- Centos 7 - Centos 7
- RHEL 7
## 90% Supported OSes for NOC ## 90% Supported OSes for NOC
- FreeBSD 10 - FreeBSD 12
- RHEL 7
- Oracle Linux 7 - Oracle Linux 7
## Install ## Install
...@@ -24,26 +24,6 @@ The easiest method of installation and update is to use docker and docker-compos ...@@ -24,26 +24,6 @@ The easiest method of installation and update is to use docker and docker-compos
If tower and node does not have direct access to the internet [setup proxy](docs/proxy.md) If tower and node does not have direct access to the internet [setup proxy](docs/proxy.md)
#### Install python-pip
<details>
<summary>CentOS/RHEL </summary>
<pre><code>
yum install python-setuptools
easy_install pip
</code></pre>
</details>
<details>
<summary>Debian/Ubuntu</summary>
<pre><code>
apt update
apt install --no-install-recommends python-pip curl python-setuptools
</code></pre>
</details>
#### Install docker daemon #### Install docker daemon
``` ```
curl https://get.docker.com | sudo sh curl https://get.docker.com | sudo sh
...@@ -53,9 +33,9 @@ systemctl enable docker ...@@ -53,9 +33,9 @@ systemctl enable docker
#### Install docker compose #### Install docker compose
``` ```
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
# If u have an error about setuptools: pip install --upgrade setuptools sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
mkdir /etc/docker-compose/tower -p mkdir /etc/docker-compose/tower -p
``` ```
...@@ -86,7 +66,7 @@ On each node ...@@ -86,7 +66,7 @@ On each node
* double check that python2.7 is installed on nodes * double check that python2.7 is installed on nodes
* create ansible user (*ansible* by default) and define ansible user's password, you'll need it later. * create ansible user (*ansible* by default) and define ansible user's password, you'll need it later.
``` ```
useradd -d /home/ansible -s /bin/bash -m ansible` useradd -d /home/ansible -s /bin/bash -m ansible
passwd ansible passwd ansible
``` ```
* grant it passwordless `sudo` privileges(`ansible ALL=(ALL) NOPASSWD:ALL` in /etc/sudoers) and copy Tower's public ssh key (*/opt/tower/var/tower/data/deploy_keys/id_rsa.pub*) to *ansible's* * grant it passwordless `sudo` privileges(`ansible ALL=(ALL) NOPASSWD:ALL` in /etc/sudoers) and copy Tower's public ssh key (*/opt/tower/var/tower/data/deploy_keys/id_rsa.pub*) to *ansible's*
......
name: noc-tower name: noc-tower
description: NocTower description: NocTower
version: 0.0.1 version: 0.0.1
appVersion: 0.4.7 appVersion: 0.4.8
keywords: keywords:
- NocProject - NocProject
sources: sources:
......
...@@ -10,7 +10,7 @@ pycparser>=2.10 ...@@ -10,7 +10,7 @@ pycparser>=2.10
singledispatch>=3.4.0.0 singledispatch>=3.4.0.0
six>=1.8.0 six>=1.8.0
tornado==4.4.2 tornado==4.4.2
ansible==2.8.8 ansible==2.9.6
setuptools>=11.3 setuptools>=11.3
packaging packaging
appdirs appdirs
......
...@@ -73,7 +73,7 @@ def migrate(migrator): ...@@ -73,7 +73,7 @@ def migrate(migrator):
is_default = BooleanField(default=False) is_default = BooleanField(default=False)
for env in Environment.select(): for env in Environment.select():
config = yaml.load(env.service_config) config = yaml.full_load(env.service_config)
if "session_ttl" in config[None]["login"]: if "session_ttl" in config[None]["login"]:
if "d" not in str(config[None]["login"]["session_ttl"]): if "d" not in str(config[None]["login"]["session_ttl"]):
config[None]["login"]["session_ttl"] = str(config[None]["login"]["session_ttl"]) + "d" config[None]["login"]["session_ttl"] = str(config[None]["login"]["session_ttl"]) + "d"
......
...@@ -74,7 +74,7 @@ def migrate(migrator): ...@@ -74,7 +74,7 @@ def migrate(migrator):
if len(Environment.select()) != 0: if len(Environment.select()) != 0:
for env in Environment.select(): for env in Environment.select():
print("Migrating %s" % env.name) print("Migrating %s" % env.name)
config = yaml.load(env.service_config) config = yaml.full_load(env.service_config)
if not config: if not config:
continue continue
config[None]["influxdb"] = { config[None]["influxdb"] = {
......
...@@ -153,7 +153,7 @@ def migrate(migrator): ...@@ -153,7 +153,7 @@ def migrate(migrator):
loglevel="info" loglevel="info"
).save() ).save()
# Adjust service config # Adjust service config
config = yaml.load(env.service_config) or {None: {}} config = yaml.full_load(env.service_config) or {None: {}}
config[None]["telegraf"] = { config[None]["telegraf"] = {
"telegraf_output_plugin": "influx" "telegraf_output_plugin": "influx"
} }
......
...@@ -36,7 +36,7 @@ def migrate(migrator): ...@@ -36,7 +36,7 @@ def migrate(migrator):
if len(Environment.select()) != 0: if len(Environment.select()) != 0:
for env in Environment.select(): for env in Environment.select():
print("Migrating %s" % env.name) print("Migrating %s" % env.name)
config = yaml.load(env.service_config) config = yaml.full_load(env.service_config)
if not config: if not config:
continue continue
if env.custom_repo: if env.custom_repo:
......
...@@ -59,7 +59,7 @@ def migrate(migrator): ...@@ -59,7 +59,7 @@ def migrate(migrator):
print("Migrating %s" % env.name) print("Migrating %s" % env.name)
# remove nodes without services # remove nodes without services
config = yaml.load(env.service_config) config = yaml.full_load(env.service_config)
if not config: if not config:
continue continue
# move settings from environment to service # move settings from environment to service
......
...@@ -425,7 +425,7 @@ class Environment(Model): ...@@ -425,7 +425,7 @@ class Environment(Model):
if not os.path.exists(path): if not os.path.exists(path):
continue continue
with open(path) as f: with open(path) as f:
descr = yaml.load(f) descr = yaml.full_load(f)
if not descr: if not descr:
continue continue
if "services" not in descr or not descr["services"]: if "services" not in descr or not descr["services"]:
......
...@@ -46,7 +46,7 @@ class Service(Model): ...@@ -46,7 +46,7 @@ class Service(Model):
if not os.path.exists(path): if not os.path.exists(path):
continue continue
with open(path) as f: with open(path) as f:
descr = yaml.load(f) descr = yaml.full_load(f)
if not descr: if not descr:
continue continue
for srv in sorted(descr["services"]): for srv in sorted(descr["services"]):
......
...@@ -55,7 +55,7 @@ var desktop = { ...@@ -55,7 +55,7 @@ var desktop = {
{ {
id: "version", id: "version",
icon: "info", icon: "info",
value: "Version: 0.4.7" value: "Version: 0.4.8"
} }
] ]
} }
......
...@@ -35,6 +35,7 @@ var environment_logic = { ...@@ -35,6 +35,7 @@ var environment_logic = {
config_order: "yaml:///opt/noc/etc/tower.yml,yaml:///opt/noc/etc/settings.yml,env:///NOC", config_order: "yaml:///opt/noc/etc/tower.yml,yaml:///opt/noc/etc/settings.yml,env:///NOC",
name: "NOC" name: "NOC"
}); });
$$("pulled_label").setHTML("");
}, },
on_save: function () { on_save: function () {
...@@ -85,6 +86,17 @@ var environment_logic = { ...@@ -85,6 +86,17 @@ var environment_logic = {
on_edit: function () { on_edit: function () {
var data = $$("environment_list").getSelectedItem(); var data = $$("environment_list").getSelectedItem();
$$("environment_form").setValues(data); $$("environment_form").setValues(data);
API.pull.is_pulled(data.id).then(
function (result) {
if (result) {
$$("pulled_label").setHTML("<span style='color: red; font-weight: bold;'>Playbook Repo is pulled, now you can only change branch, not URL. To change URL you have to manually remove playbook dir from %TOWER%/var/tower/playbooks/%Env name%</span>");
} else {
$$("pulled_label").setHTML("");
}
}, function (err) {
Tower.msg.failed("Cannot connect to server");
}
);
environment_logic.show_form(); environment_logic.show_form();
}, },
...@@ -174,9 +186,9 @@ var environment_logic = { ...@@ -174,9 +186,9 @@ var environment_logic = {
var env_id = app_logic.current_env.id, var env_id = app_logic.current_env.id,
env_name = app_logic.current_env.name, env_name = app_logic.current_env.name,
rx_progress = /^(ok|changed|unreachable|failed|fatal): \[/mg, rx_progress = /^(ok|changed|unreachable|failed|fatal): \[/mg,
rx_task = /^.+?\*{5}\s*$/mg, rx_task = /^.+?\*{3}\s*$/mg,
rx_line = /^(ok|changed|unreachable|failed|fatal|skipping): \[.+?$/mg, rx_line = /^(ok|changed|unreachable|failed|fatal|skipping): \[.+?$/mg,
rx_stars = /\s+\*{5,}/; rx_stars = /\s+\*{3,}/;
deploy = function () { deploy = function () {
var xhr = new XMLHttpRequest(), var xhr = new XMLHttpRequest(),
offset = 0, offset = 0,
......
...@@ -226,6 +226,14 @@ var environment_form = { ...@@ -226,6 +226,14 @@ var environment_form = {
label: "Repo", label: "Repo",
body: { body: {
rows: [ rows: [
{ cols: [
{
view: "label",
label: "",
id: "pulled_label",
}
]
},
{ {
cols: [ cols: [
{ {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment