1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_ntp.git synced 2024-08-16 12:59:49 +02:00

add FreeBSD support

This commit is contained in:
diodonfrost 2018-12-28 12:26:05 +01:00
parent 90513a07ed
commit f3ef161a73
13 changed files with 179 additions and 2 deletions

107
.kitchen-vagrant.yml Normal file
View file

@ -0,0 +1,107 @@
---
# we use docker as plateform
driver:
name: vagrant
# Ansible will be our provisioner
provisioner:
name: ansible_playbook
hosts: localhost
require_chef_for_busser: false
require_ruby_for_busser: false
require_ansible_omnibus: false
idempotency_test: true
# We use Inspec as testing framework
verifier:
name: inspec
inspec_tests:
- path: tests/inspec
# Build platforms
platforms:
# Standard Linux
- name: centos-7
- name: centos-6
- name: fedora-28
- name: fedora-27
- name: fedora-26
- name: ubuntu-18.04
- name: ubuntu-17.10
- name: ubuntu-16.04
- name: ubuntu-14.04
- name: debian-9
- name: debian-8
- name: debian-7
- name: oraclelinux-7
driver:
box: bento/oracle-7
- name: oraclelinux-6
driver:
box: bento/oracle-6
# Archlinux
- name: archlinux-rolling
driver:
box: archlinux/archlinux
provision: true
vagrantfiles:
- tests/vagrant/vagrant_archlinux_target.rb
# Gentoo
- name: gentoo
driver:
box: generic/gentoo
provision: true
vagrantfiles:
- tests/vagrant/vagrant_gentoo_target.rb
# FreeBSD
- name: freebsd-11.2
driver:
box: bento/freebsd-11.2
provision: true
vagrantfiles:
- tests/vagrant/vagrant_freebsd_target.rb
- name: freebsd-10.4
driver:
box: bento/freebsd-10.4
provision: true
vagrantfiles:
- tests/vagrant/vagrant_freebsd_target.rb
- name: freebsd-10.3
driver:
box: bento/freebsd-10.3
provision: true
vagrantfiles:
- tests/vagrant/vagrant_freebsd_target.rb
# OpenBSD
- name: openbsd-6
driver:
box: generic/openbsd6
provision: true
vagrantfiles:
- tests/vagrant/vagrant_openbsd_target.rb
# Mac osx
- name: macosx-10.11
driver:
box: jhcook/osx-elcapitan-10.11
provision: true
provisioner:
name: ansible_playbook
ansible_binary_path: /usr/local/bin/
- name: macosx-10.10
driver:
box: jhcook/osx-yosemite-10.10
provision: true
provisioner:
name: ansible_playbook
ansible_binary_path: /usr/local/bin/
suites:
- name: default
provisioner:
name: ansible_playbook
playbook: tests/test.yml

View file

@ -147,7 +147,6 @@ platforms:
driver:
image: diodonfrost/archlinux-rolling-ansible
run_command: /usr/lib/systemd/systemd
platform: arch
provision_command:
- sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config
- systemctl enable sshd

View file

@ -63,6 +63,11 @@ Supported platforms:
- name: Gentoo
versions:
- stage3
- name: FreeBSD
versions:
- 11.2
- 10.4
- 10.3
```
## Role Variables

View file

@ -58,6 +58,11 @@ galaxy_info:
- name: Gentoo
versions:
- stage3
- name: FreeBSD
versions:
- 11.2
- 10.4
- 10.3
galaxy_tags:
- system

View file

@ -0,0 +1,13 @@
---
# Tasks file for install ntp daemon on FreeBSD system
- name: Install ntp daemon on FreeBSD
package:
name: "{{ ntp_package }}"
state: present
- name: Service ntp on FreeBSD
service:
name: "{{ ntp_service }}"
enabled: yes
state: started

View file

@ -0,0 +1,5 @@
Vagrant.configure(2) do |config|
config.vm.provision "shell", inline: <<-SHELL
pacman --noconfirm -Syu ansible
SHELL
end

View file

@ -0,0 +1,7 @@
Vagrant.configure(2) do |config|
config.vm.provision "shell", inline: <<-SHELL
pkg install -y ncurses python
pkg install -y py27-ansible
ln -s /usr/local/bin/python2.7 /usr/bin/python
SHELL
end

View file

@ -0,0 +1,11 @@
Vagrant.configure(2) do |config|
config.vm.provision "shell", inline: <<-SHELL
emerge --sync
echo 'USE=-bindist' >> /etc/portage/make.conf
echo 'dev-lang/python sqlite' >> /etc/portage/package.use/python
emerge net-misc/openssh app-admin/sudo app-admin/ansible app-portage/gentoolkit
# Enable features on specific package for java install
echo 'x11-libs/cairo X' > /etc/portage/package.use/cairo
echo 'app-text/ghostscript-gpl cups' > /etc/portage/package.use/ghostscript-gpl
SHELL
end

View file

@ -0,0 +1,9 @@
Vagrant.configure(2) do |config|
config.vm.provision "shell", inline: <<-SHELL
OPENBSD_VERSION=`uname -a | awk -F " " '{print $3}'`
wget -P /tmp https://ftp.openbsd.org/pub/OpenBSD/${OPENBSD_VERSION}/amd64/xbase64.tgz
cd / && tar xzvphf /tmp/xbase64.tgz
pkg_add -z ansible
ln -s /usr/local/bin/python2.7 /usr/bin/python
SHELL
end

View file

@ -0,0 +1,10 @@
Vagrant.configure(2) do |config|
config.vm.provision "shell", inline: <<-SHELL
pkg install -r gcc
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
tar zxvf Python-3.7.1.tgz && cd Python-3.7.1
./configure
make
make install
SHELL
end

View file

@ -0,0 +1,4 @@
Vagrant.configure("2") do |c|
c.vm.provision :shell, path: "https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1"
c.vm.provision :shell, path: "https://chocolatey.org/install.ps1"
end

2
vars/FreeBSD.yml Normal file
View file

@ -0,0 +1,2 @@
ntp_package: ntp
ntp_service: ntpd

View file

@ -1,2 +1,2 @@
ntp_package: ntp
ntp_service: ntp
ntp_service: ntpd