Commit 44a9b5fa authored by EKbfh's avatar EKbfh 🐼
Browse files

Merge branch 'freebsd_python3' into 'master'

Bring python3 to FreeBSD

See merge request !60
parents 1f3113f2 1bafb34b
Pipeline #23181 failed with stages
in 4 minutes and 50 seconds
## Preparation ## Preparation
### Install tower prerequisites on FreeBSD ### Install tower prerequisites on FreeBSD
```shell ```shell
root@tower:~ # pkg install -y ca_root_nss python27 libffi py27-setuptools py27-pip py27-virtualenv py27-sqlite3 git root@tower:~ # pkg install -y ca_root_nss python libffi py37-setuptools py37-pip py37-virtualenv py37-sqlite3 git
root@tower:~ # pw groupadd -n tower root@tower:~ # pw groupadd -n tower
root@tower:~ # pw useradd -g tower -s /bin/csh -d /home/tower -n tower -m root@tower:~ # pw useradd -g tower -s /bin/csh -d /home/tower -n tower -m
``` ```
...@@ -24,7 +24,7 @@ If you're in csh, rehash first ...@@ -24,7 +24,7 @@ If you're in csh, rehash first
/usr/local/tower# rehash /usr/local/tower# rehash
``` ```
```shell ```shell
root@tower:/usr/local/tower # virtualenv-2.7 . root@tower:/usr/local/tower # virtualenv .
``` ```
- Install Tower - Install Tower
...@@ -62,18 +62,9 @@ root@noc:~ # sysrc syslogd_flags="-s -p /var/run/log -p /var/run/syslog" ...@@ -62,18 +62,9 @@ root@noc:~ # sysrc syslogd_flags="-s -p /var/run/log -p /var/run/syslog"
root@noc:~ # service syslogd restart root@noc:~ # service syslogd restart
``` ```
* If node will run postgresql, you'll need to do the trick: add postgresql server as a package first, then build databases/py-psycopg2 from ports with python 2.7:
```shell
root@noc:~ # pkg install -y postgresql95-server
root@noc:~ # sysrc postgresql_enable="YES"
root@noc:~ # cd /usr/ports/databases/py-psycopg2
root@noc:~ # sed -i.bak 's/^\(USES.*python\)/\1:2.7/' Makefile
root@noc:~ # make install clean
```
* Add python for ansible, ansible user and sudo: * Add python for ansible, ansible user and sudo:
```shell ```shell
root@noc:~ # pkg install -y python2 sudo root@noc:~ # pkg install -y python sudo
root@noc:~ # pw groupadd -n ansible root@noc:~ # pw groupadd -n ansible
root@noc:~ # pw useradd -g ansible -s /bin/csh -d /home/ansible -n ansible -m root@noc:~ # pw useradd -g ansible -s /bin/csh -d /home/ansible -n ansible -m
root@noc:~ # echo "ansible ALL=(ALL) NOPASSWD: ALL" > /usr/local/etc/sudoers.d/ansible root@noc:~ # echo "ansible ALL=(ALL) NOPASSWD: ALL" > /usr/local/etc/sudoers.d/ansible
...@@ -120,10 +111,3 @@ exec.poststart = "cp /var/run/dmesg.boot /usr/j/noc/s/var/run/"; ...@@ -120,10 +111,3 @@ exec.poststart = "cp /var/run/dmesg.boot /usr/j/noc/s/var/run/";
Do not forget to change tower's admin password Do not forget to change tower's admin password
(Upper right menu > Change Password) (Upper right menu > Change Password)
# After deployment
* Change `noc/etc/noc_services.conf`, FreeBSD doesn't have `taskset` and `nproc` utilities, so command for `activator-default` should be:
```shell
[program:activator-default]
command = /bin/sh -c 'exec cpuset -l $((%(process_num)d %% $(/sbin/sysctl -n hw.ncpu))) ./services/activator/service.py'
```
...@@ -34,7 +34,7 @@ def migrate(migrator): ...@@ -34,7 +34,7 @@ def migrate(migrator):
NodeType( NodeType(
name="FreeBSD", name="FreeBSD",
shell_type="csh", shell_type="csh",
python_interpreter="/usr/local/bin/python2.7", python_interpreter="/usr/local/bin/python",
ssh_pipelining=True, ssh_pipelining=True,
ansible_connection="ssh" ansible_connection="ssh"
).save() ).save()
......
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