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]
current_version = 0.4.7
current_version = 0.4.8
commit = False
tag = False
serialize = {major}.{minor}.{patch}
......
## Future
## 0.4.8 (2020-03-XX)
### Release Notes
* Fix pool edit
* Fix Default node type
* Fix YAML warning
* Bump ansible to 2.9.6
## 0.4.7 (2019-12-03)
### Release Notes
......
......@@ -10,10 +10,10 @@ NOC (http://nocproject.org/) installations.
- Ubuntu 16 LTS
- Ubuntu 18 LTS
- Centos 7
- RHEL 7
## 90% Supported OSes for NOC
- FreeBSD 10
- RHEL 7
- FreeBSD 12
- Oracle Linux 7
## Install
......@@ -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)
#### 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
```
curl https://get.docker.com | sudo sh
......@@ -53,9 +33,9 @@ systemctl enable docker
#### 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
# 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
```
......@@ -86,7 +66,7 @@ On each node
* 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.
```
useradd -d /home/ansible -s /bin/bash -m ansible`
useradd -d /home/ansible -s /bin/bash -m 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*
......
name: noc-tower
description: NocTower
version: 0.0.1
appVersion: 0.4.7
appVersion: 0.4.8
keywords:
- NocProject
sources:
......
......@@ -10,7 +10,7 @@ pycparser>=2.10
singledispatch>=3.4.0.0
six>=1.8.0
tornado==4.4.2
ansible==2.8.8
ansible==2.9.6
setuptools>=11.3
packaging
appdirs
......
......@@ -73,7 +73,7 @@ def migrate(migrator):
is_default = BooleanField(default=False)
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 "d" not in str(config[None]["login"]["session_ttl"]):
config[None]["login"]["session_ttl"] = str(config[None]["login"]["session_ttl"]) + "d"
......
......@@ -74,7 +74,7 @@ def migrate(migrator):
if len(Environment.select()) != 0:
for env in Environment.select():
print("Migrating %s" % env.name)
config = yaml.load(env.service_config)
config = yaml.full_load(env.service_config)
if not config:
continue
config[None]["influxdb"] = {
......
......@@ -153,7 +153,7 @@ def migrate(migrator):
loglevel="info"
).save()
# Adjust service config
config = yaml.load(env.service_config) or {None: {}}
config = yaml.full_load(env.service_config) or {None: {}}
config[None]["telegraf"] = {
"telegraf_output_plugin": "influx"
}
......
......@@ -36,7 +36,7 @@ def migrate(migrator):
if len(Environment.select()) != 0:
for env in Environment.select():
print("Migrating %s" % env.name)
config = yaml.load(env.service_config)
config = yaml.full_load(env.service_config)
if not config:
continue
if env.custom_repo:
......
......@@ -59,7 +59,7 @@ def migrate(migrator):
print("Migrating %s" % env.name)
# remove nodes without services
config = yaml.load(env.service_config)
config = yaml.full_load(env.service_config)
if not config:
continue
# move settings from environment to service
......
......@@ -425,7 +425,7 @@ class Environment(Model):
if not os.path.exists(path):
continue
with open(path) as f:
descr = yaml.load(f)
descr = yaml.full_load(f)
if not descr:
continue
if "services" not in descr or not descr["services"]:
......
......@@ -46,7 +46,7 @@ class Service(Model):
if not os.path.exists(path):
continue
with open(path) as f:
descr = yaml.load(f)
descr = yaml.full_load(f)
if not descr:
continue
for srv in sorted(descr["services"]):
......
......@@ -55,7 +55,7 @@ var desktop = {
{
id: "version",
icon: "info",
value: "Version: 0.4.7"
value: "Version: 0.4.8"
}
]
}
......
......@@ -35,6 +35,7 @@ var environment_logic = {
config_order: "yaml:///opt/noc/etc/tower.yml,yaml:///opt/noc/etc/settings.yml,env:///NOC",
name: "NOC"
});
$$("pulled_label").setHTML("");
},
on_save: function () {
......@@ -85,6 +86,17 @@ var environment_logic = {
on_edit: function () {
var data = $$("environment_list").getSelectedItem();
$$("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();
},
......@@ -174,9 +186,9 @@ var environment_logic = {
var env_id = app_logic.current_env.id,
env_name = app_logic.current_env.name,
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_stars = /\s+\*{5,}/;
rx_stars = /\s+\*{3,}/;
deploy = function () {
var xhr = new XMLHttpRequest(),
offset = 0,
......
......@@ -226,6 +226,14 @@ var environment_form = {
label: "Repo",
body: {
rows: [
{ cols: [
{
view: "label",
label: "",
id: "pulled_label",
}
]
},
{
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