Open Infiniverse opened 8 years ago
Hi, it certainly is work in progress. But despite that I manage a few server using the roles I created. I use iocage
to create the jails. There is a role which is named freebsd-jailed
which does the jail creation. I am not sure if the current configuration for this project runs without any issues, but I'll check that today.
If this does not answer your question, please get in touch.
it doesn't. at least anymore. on 10.2 with pkg
version 1.9.4
$ vagrant up btsync
[...]
TASK [JoergFiedler.freebsd-jail-host : Install additional packages] ************
failed: [btsync] (item=[u'tmux']) => {"failed": true, "item": ["tmux"], "msg": "failed to install tmux: The following 2 package(s) will be affected (of 0 checked):\n\nNew packages to be INSTALLED:\n\ttmux: 2.3_1\n\tlibevent2: 2.1.8\n\nNumber of packages to be installed: 2\n\nThe process will require 3 MiB more space.\n526 KiB to be downloaded.\nFetching tmux-2.3_1.txz: .......... done\nFetching libevent2-2.1.8.txz: .......... done\nChecking integrity... done (0 conflicting)\n[1/2] Installing libevent2-2.1.8...\n[1/2] Extracting libevent2-2.1.8: ", "stderr": "/usr/local/lib/libpkg.so.3: Undefined symbol \"utimensat\"\n"}
i think the issue is the newest pkg
version. possibly being build for a new freebsd version.
but this would confuse me because the freebsd repo should respect the ABI since:
$ cat /usr/local/etc/pkg/repos/FreeBSD.conf
FreeBSD: {
url: "pkg+http://pkg.eu.FreeBSD.org/${ABI}/latest",
enabled: yes
}
manually:
$ sudo pkg install -y tmux
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Checking integrity... done (0 conflicting)
The following 2 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
tmux: 2.3_1
libevent2: 2.1.8
Number of packages to be installed: 2
The process will require 3 MiB more space.
[1/2] Installing libevent2-2.1.8...
[1/2] Extracting libevent2-2.1.8: 0%/usr/local/lib/libpkg.so.3: Undefined symbol "utimensat"
also, i had to do this to have ansible-galaxy
not complain about roles missing from the central repo.
diff --git a/roles.yml b/roles.yml
index 985a920..59732de 100644
--- a/roles.yml
+++ b/roles.yml
@@ -10,14 +10,10 @@
- src: JoergFiedler.freebsd-jailed-btsync
version: v1.0.0
- src: JoergFiedler.freebsd-jailed-mariadb
- version: v1.0.0
+ version: master
- src: JoergFiedler.freebsd-jailed-nginx
version: v1.0.0
- src: JoergFiedler.freebsd-jailed-joomla
version: master
-- src: JoergFiedler.freebsd-jailed-php-fpm
- version: master
-- src: JoergFiedler.freebsd-jailed-sftp
- version: master
- src: JoergFiedler.freebsd-jailed-wordpress
version: master
it runs successfully on freebsd 11. but vagrant up btsync
only creates 1 jail:
$ sudo iocage list
JID UUID BOOT STATE TAG IP
1 b1d98d3d-f21c-11e6-a3e2-080027a82d61 on up syslogd.darkcity 10.1.0.3
😿
... because it seems to be running the jailed playbook with the same paramters multiple times when it should run with playbook-specific params. weird.
PLAY [btsync] ******************************************************************
TASK [setup] *******************************************************************
ok: [btsync]
TASK [JoergFiedler.freebsd-jail-host : include] ********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jail-host/tasks/net.yml for btsync
TASK [JoergFiedler.freebsd-jail-host : Configure internal ip on jails network interface] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Add internal ip to jails network interface] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Get hostname] ***************************
ok: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Set hostname] ***************************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Add hostname to rc.conf] ****************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : include] ********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jail-host/tasks/pf.yml for btsync
TASK [JoergFiedler.freebsd-jail-host : Copy pf.conf] ***************************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Ensure nat jails definition file exists]
changed: [btsync]
[WARNING]: Consider using file module with state=touch rather than running
touch
TASK [JoergFiedler.freebsd-jail-host : Ensure nat jail rules definition file exists] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Ensure rdr jail rules definition file exists] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Ensure rls jail rules definition file exists] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : include] ********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jail-host/tasks/sshd.yml for btsync
TASK [JoergFiedler.freebsd-jail-host : Adjust sshd (allowed user, authentication, ..)] ***
changed: [btsync] => (item={u'regexp': u'^Port', u'line': u'Port 22'})
changed: [btsync] => (item={u'regexp': u'^Protocol', u'line': u'Protocol 2'})
changed: [btsync] => (item={u'regexp': u'^AllowUsers', u'line': u'AllowUsers vagrant'})
changed: [btsync] => (item={u'regexp': u'^MaxStartups', u'line': u'MaxStartups 3:50:5'})
changed: [btsync] => (item={u'regexp': u'^MaxAuthTries', u'line': u'MaxAuthTries 1'})
changed: [btsync] => (item={u'regexp': u'^LoginGraceTime', u'line': u'LoginGraceTime 5'})
changed: [btsync] => (item={u'regexp': u'^ChallengeResponseAuthentication', u'line': u'ChallengeResponseAuthentication no'})
changed: [btsync] => (item={u'regexp': u'^PasswordAuthentication', u'line': u'PasswordAuthentication no'})
changed: [btsync] => (item={u'regexp': u'^UseDNS', u'line': u'UseDNS no'})
changed: [btsync] => (item={u'regexp': u'^UsePAM', u'line': u'UsePAM no'})
changed: [btsync] => (item={u'regexp': u'^ClientAliveInterval', u'line': u'ClientAliveInterval 30'})
TASK [JoergFiedler.freebsd-jail-host : include] ********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jail-host/tasks/packages.yml for btsync
TASK [JoergFiedler.freebsd-jail-host : Update pkg] *****************************
ok: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Install additional packages] ************
changed: [btsync] => (item=[u'tmux'])
TASK [JoergFiedler.freebsd-jail-host : include] ********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jail-host/tasks/zpool.yml for btsync
TASK [JoergFiedler.freebsd-jail-host : Ensure ZFS is started] ******************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Check if ioc zpool exists] **************
ok: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Create ioc zpool] ***********************
skipping: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Check if srv zpool exists] **************
ok: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Create srv zpool] ***********************
skipping: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Create srv dataset] *********************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Copy periodic conf for regular snapshots] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Install zfs-peridic package] ************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Create entry in crontab to create hourly snapshots] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : include] ********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jail-host/tasks/iocage.yml for btsync
TASK [JoergFiedler.freebsd-jail-host : Install iocage] *************************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Mark zpool for iocage usage] ************
ok: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Fetch FreeBSD release] ******************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Enable iocage service] ******************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : include] ********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jail-host/tasks/user.yml for btsync
TASK [JoergFiedler.freebsd-jail-host : Update comment for root user in user database] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Add sudo rules for ssh user on jail host] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Create .ssh directry for ssh user] ******
ok: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Copy authorized keys file] **************
ok: [btsync]
TASK [JoergFiedler.freebsd-jail-host : include] ********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jail-host/tasks/timezone.yml for btsync
TASK [JoergFiedler.freebsd-jail-host : Read current timezone info] *************
fatal: [btsync]: FAILED! => {"changed": false, "cmd": ["cat", "/var/db/zoneinfo"], "delta": "0:00:00.024090", "end": "2017-02-13 18:46:05.547458", "failed": true, "rc": 1, "start": "2017-02-13 18:46:05.523368", "stderr": "cat: /var/db/zoneinfo: No such file or directory", "stdout": "", "stdout_lines": [], "warnings": []}
...ignoring
TASK [JoergFiedler.freebsd-jail-host : Set timezone info] **********************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : include] ********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jail-host/tasks/ssmtp.yml for btsync
TASK [JoergFiedler.freebsd-jail-host : Install ssmtp for easy mail forwarding] *
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Copy ssmtp.conf into place] *************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Copy mailer configuration into place] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : include] ********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jail-host/tasks/ntp.yml for btsync
TASK [JoergFiedler.freebsd-jail-host : Copy ntp config] ************************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Activate NTP deamon] ********************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : Adjust time on boot] ********************
changed: [btsync]
TASK [JoergFiedler.freebsd-jail-host : include] ********************************
skipping: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/iocage.yml for btsync
TASK [JoergFiedler.freebsd-jailed : debug] *************************************
ok: [btsync] => {
"msg": "Running tasks for jail syslogd.darkcity"
}
TASK [JoergFiedler.freebsd-jailed : Check if jail already exists] **************
fatal: [btsync]: FAILED! => {"changed": false, "cmd": "/usr/local/sbin/iocage get host_hostuuid syslogd.darkcity", "delta": "0:00:00.122381", "end": "2017-02-13 19:46:13.440361", "failed": true, "rc": 1, "start": "2017-02-13 19:46:13.317980", "stderr": "", "stdout": " ERROR: jail syslogd.darkcity not found!", "stdout_lines": [" ERROR: jail syslogd.darkcity not found!"], "warnings": []}
...ignoring
TASK [JoergFiedler.freebsd-jailed : Create jail] *******************************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : Get jail s UUID] ***************************
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : Set jail properties] ***********************
changed: [btsync] => (item=boot=on)
changed: [btsync] => (item=hostname=syslogd.darkcity)
TASK [JoergFiedler.freebsd-jailed : Register home diretory] ********************
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/net.yml for btsync
TASK [JoergFiedler.freebsd-jailed : Add network config] ************************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : Activate network config] *******************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/repo.yml for btsync
TASK [JoergFiedler.freebsd-jailed : Create directory which will hold build repo conf] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : Create directory which will hold build server key] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : Copy build server key] *********************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : Install build server repo] *****************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : Update build server repo data] *************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : Install root certificate authorities] ******
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/pf.yml for btsync
TASK [JoergFiedler.freebsd-jailed : Copy pf configuration (nat rules)] *********
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : Add pf configuration to anchor.nat-jail conf] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/user.yml for btsync
TASK [JoergFiedler.freebsd-jailed : Update root user] **************************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : Update user database I] ********************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : Update user database II] *******************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/timezone.yml for btsync
TASK [JoergFiedler.freebsd-jailed : Read current timezone info] ****************
fatal: [btsync]: FAILED! => {"changed": false, "cmd": ["cat", "/iocage/jails/b1d98d3d-f21c-11e6-a3e2-080027a82d61/root/var/db/zoneinfo"], "delta": "0:00:00.017915", "end": "2017-02-13 19:47:19.748061", "failed": true, "rc": 1, "start": "2017-02-13 19:47:19.730146", "stderr": "cat: /iocage/jails/b1d98d3d-f21c-11e6-a3e2-080027a82d61/root/var/db/zoneinfo: No such file or directory", "stdout": "", "stdout_lines": [], "warnings": []}
...ignoring
TASK [JoergFiedler.freebsd-jailed : Set timezone info] *************************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
skipping: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/ssmtp.yml for btsync
TASK [JoergFiedler.freebsd-jailed : Install ssmtp for easy mail forwarding] ****
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : Copy ssmtp.conf into place] ****************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : Copy mailer configuration into place] ******
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-syslogd : include] ***************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed-syslogd/tasks/pf.yml for btsync
TASK [JoergFiedler.freebsd-jailed-syslogd : Copy pf configuration (rls rules)] *
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-syslogd : Add pf configuration to anchor.rls-jail conf] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-syslogd : include] ***************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed-syslogd/tasks/syslogd.yml for btsync
TASK [JoergFiedler.freebsd-jailed-syslogd : Add syslogd flags to rc.conf] ******
changed: [btsync] => (item={u'regexp': u'^syslogd_enable=', u'line': u'syslogd_enable="YES"'})
changed: [btsync] => (item={u'regexp': u'^syslogd_flags=', u'line': u'syslogd_flags="-n -a 10.1.0.3/24:* -b 10.1.0.3"'})
TASK [JoergFiedler.freebsd-jailed-syslogd : Copy syslog.conf] ******************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/iocage.yml for btsync
TASK [JoergFiedler.freebsd-jailed : debug] *************************************
ok: [btsync] => {
"msg": "Running tasks for jail syslogd.darkcity"
}
TASK [JoergFiedler.freebsd-jailed : Check if jail already exists] **************
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : Create jail] *******************************
skipping: [btsync]
TASK [JoergFiedler.freebsd-jailed : Get jail s UUID] ***************************
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : Set jail properties] ***********************
skipping: [btsync] => (item=boot=on)
skipping: [btsync] => (item=hostname=syslogd.darkcity)
TASK [JoergFiedler.freebsd-jailed : Register home diretory] ********************
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/net.yml for btsync
TASK [JoergFiedler.freebsd-jailed : Add network config] ************************
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : Activate network config] *******************
skipping: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/repo.yml for btsync
TASK [JoergFiedler.freebsd-jailed : Create directory which will hold build repo conf] ***
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : Create directory which will hold build server key] ***
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : Copy build server key] *********************
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : Install build server repo] *****************
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : Update build server repo data] *************
skipping: [btsync]
TASK [JoergFiedler.freebsd-jailed : Install root certificate authorities] ******
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/pf.yml for btsync
TASK [JoergFiedler.freebsd-jailed : Copy pf configuration (nat rules)] *********
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : Add pf configuration to anchor.nat-jail conf] ***
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/user.yml for btsync
TASK [JoergFiedler.freebsd-jailed : Update root user] **************************
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : Update user database I] ********************
skipping: [btsync]
TASK [JoergFiedler.freebsd-jailed : Update user database II] *******************
skipping: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/timezone.yml for btsync
TASK [JoergFiedler.freebsd-jailed : Read current timezone info] ****************
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : Set timezone info] *************************
skipping: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/syslogd-client.yml for btsync
TASK [JoergFiedler.freebsd-jailed : Configure syslog] **************************
skipping: [btsync]
TASK [JoergFiedler.freebsd-jailed : Enable remote syslog logging] **************
skipping: [btsync]
TASK [JoergFiedler.freebsd-jailed : include] ***********************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed/tasks/ssmtp.yml for btsync
TASK [JoergFiedler.freebsd-jailed : Install ssmtp for easy mail forwarding] ****
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : Copy ssmtp.conf into place] ****************
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed : Copy mailer configuration into place] ******
ok: [btsync]
TASK [JoergFiedler.freebsd-jailed-btsync : include] ****************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed-btsync/tasks/zfs.yml for btsync
TASK [JoergFiedler.freebsd-jailed-btsync : Create btsync s ZFS dataset s mount point] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-btsync : Create btsync ZFS dataset] **********
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-btsync : Create btsync instance s ZFS dataset] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-btsync : Create btsync instance's mountpoint]
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-btsync : Configure jail to mount file system from host] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-btsync : include] ****************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed-btsync/tasks/btsync.yml for btsync
TASK [JoergFiedler.freebsd-jailed-btsync : Install btsync] *********************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-btsync : Copy btsync configuration] **********
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-btsync : Create directories for btsync instance] ***
changed: [btsync] => (item=sync)
changed: [btsync] => (item=.sync)
TASK [JoergFiedler.freebsd-jailed-btsync : Enable service] *********************
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-btsync : Backup btsync home with tarsnap] ****
skipping: [btsync]
TASK [JoergFiedler.freebsd-jailed-btsync : Copy btsync instance key] ***********
changed: [btsync] => (item=btsync-server-key.pem)
changed: [btsync] => (item=btsync-server-certbundle.pem)
TASK [JoergFiedler.freebsd-jailed-btsync : include] ****************************
included: /Users/jondoe/Code/freebsd-ansible-demo/playbook/roles/JoergFiedler.freebsd-jailed-btsync/tasks/pf.yml for btsync
TASK [JoergFiedler.freebsd-jailed-btsync : Copy pf configuration (nat rules)] **
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-btsync : Add pf configuration to anchor.nat-jail conf] ***
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-btsync : Copy pf configuration (rdr rules)] **
changed: [btsync]
TASK [JoergFiedler.freebsd-jailed-btsync : Add pf configuration to anchor.rdr-jail conf] ***
changed: [btsync]
RUNNING HANDLER [JoergFiedler.freebsd-jail-host : Start iocage] ****************
changed: [btsync]
[WARNING]: Consider using service module rather than running service
RUNNING HANDLER [JoergFiedler.freebsd-jail-host : Reload pf] *******************
changed: [btsync]
RUNNING HANDLER [JoergFiedler.freebsd-jail-host : Reload sshd] *****************
changed: [btsync]
RUNNING HANDLER [JoergFiedler.freebsd-jailed-btsync : Reload jail s btsync] ****
changed: [btsync]
PLAY RECAP *********************************************************************
btsync : ok=130 changed=69 unreachable=0 failed=0
@glaszig I need to apologize … this project is definitely work in progress … I haven't had time to update it in a very long time … so lets see how I can help you quickly …
maybe it might be a good idea to start this project not from scratch but reduce it to something which is helpful … for now the vagrant configuration contains a huge setup … I think it might be a good idea to create more simple playbooks and use different machine configurations for each of them … this would simplify stuff a lot …
OK … I will put a big note into README.md
as a mark that this project is broken … then I create a branch which which will only include a machine configuration for the role btsync
for a start … from there I can work myself through all the other roles (nginx, wordpress, …) and create meaningful examples, which will then work on checkout …
any more suggestions …
@glaszig pls check out branch btsync-role
… it still needs some polishment … watch out for supported ansible versions (version tested: 2.0.1.0, version kind off works: 2.1.1.0) …
things wich are missing not tested:
thanks. in my case the playbook still appears to run everything with only one (the first created) jail. am i doing something wrong?
$ ansible --version
ansible 2.0.2.0
$ sudo iocage list
JID UUID BOOT STATE TAG IP
- e0cf6a78-f2d2-11e6-a1e9-080027a82d61 on down syslogd.darkcity 10.1.0.3
RUNNING HANDLER [JoergFiedler.freebsd-jailed-sshd : Reload sshd s sshd] ********
fatal: [btsync]: FAILED! => {"changed": true, "cmd": ["/usr/local/sbin/iocage", "exec", "e0cf6a78-f2d2-11e6-a1e9-080027a82d61", "service", "sshd", "reload"], "delta": "0:00:00.154571", "end": "2017-02-14 17:40:01.426517", "failed": true, "rc": 1, "start": "2017-02-14 17:40:01.271946", "stderr": "jexec: jail \"ioc-e0cf6a78-f2d2-11e6-a1e9-080027a82d61\" not found", "stdout": "", "stdout_lines": [], "warnings": []}
$ sudo iocage exec e0cf6a78-f2d2-11e6-a1e9-080027a82d61 service sshd reload
jexec: jail "ioc-e0cf6a78-f2d2-11e6-a1e9-080027a82d61" not found
@glaszig hmm … it seems to be an issue with version 2.0.2.0 of Ansible … so, pls use version 2.0.1.0, 2.1.1.0 or 2.2.0.0 … I tried all those and they worked …
also, pls note that all roles in roles.yml
refer to master
now … I am not exactly sure if ansible-galaxy
downloads the latest version from master
so please delete all existing roles that were downloaded before … roles will by default be saved in ./playbook/roles
folder …
$ ansible --version
ansible 2.2.1.0
config file = /Users/john/project/moumantai-de/freebsd-ansible-demo/ansible.cfg
configured module search path = Default w/o overrides
$ ANSIBLE_ROLES_PATH=. vagrant up btsync
…
PLAY RECAP *********************************************************************
btsync : ok=212 changed=168 unreachable=0 failed=0
[vagrant@amnesiac ~]$ iocage list
JID UUID BOOT STATE TAG IP
1 05a9ec79-f30b-11e6-bf46-080027a82d61 on up btsync.darkcity 10.1.0.200
2 c1b34de6-f30a-11e6-bf46-080027a82d61 on up syslogd.darkcity 10.1.0.3
3 d55c23fd-f30a-11e6-bf46-080027a82d61 on up sshd.darkcity 10.1.0.2
4 eb2d0979-f30a-11e6-bf46-080027a82d61 on up proxy.darkcity 10.1.0.100
good lord! ansible is a bloody moving target.
version < 2.1 won't work because it misses the chroot
parameter which was only added in 2.1.
then there's these weird bugs with newer versions.
what a fucking mess.
anyway. seems to work with 2.1.1.0. i get 4 jails as well. thank you for the support and thank you for this brilliant demo. i really like how you put this stuff together modularly. real beautiful.
@glaszig thx … the 2.0-no-chroot issue is something I introduced … until a few days ago I provided a own pkgng.py
in library
folder of one of the roles, because chroot
was not supported until version 2.1.0.0
… I removed it in favor of using the latest version of ansible … I will see if it will work - need to update README.md
though … as you said, Ansible is a moving target and it seems there is something broken in every version … but still I like the project …
if you have any ideas suggestions regarding the roles, pls shoot …
Hey Joerg,
Does this really work - I've looked at the source to see how it drives iocage, but I can't see that it does.
Is this work in progress, or am I missing something?
Cheers :) Joe