Skip to content
Snippets Groups Projects
Commit 432ab770 authored by nimrod's avatar nimrod
Browse files

- First commit.

parents
No related branches found
No related tags found
No related merge requests found
*.swp
*.swo
~*
*~
.DS_Store
__pycache__
*.pyc
.cache/
.molecule/
.vagrant/
*.log
*.retry
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: 97b88d9610bcc03982ddac33caba98bb2b751f5f
hooks:
- id: check-added-large-files
- id: check-json
- id: check-xml
- id: check-yaml
- id: check-merge-conflict
- repo: https://www.shore.co.il/git/ansible-pre-commit/
sha: 8c4a3e7b57164d8cb0da75db3be08587d0f0b173
hooks:
- id: ansible-pre-commit
files: playbook.yml
The MIT License (MIT)
Copyright (c) [year] [fullname]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
OpenBSD bootstrap
#################
Role to bootstrap an OpenBSD instance (allow Ansible to provision the instance).
Requirements
------------
OpenBSD 5.7 or later.
Role Variables
--------------
.. code:: yaml
openbsd_pkg_mirror: http://www.mirrorservice.org/pub #OpenBSD mirror to use.
Dependencies
------------
None.
Example Playbook
----------------
.. code:: yaml
---
- hosts: all
gather_facts: False
roles:
- ansible-role-openbsd-bootstrap
Example requirements.yml
------------------------
.. code:: yaml
---
- src: https://www.shore.co.il/git/ansible-role-openbsd-bootstrap
scm: git
path: roles/
name: openbsd-bootsrrap
License
-------
This software is licensed under the MIT license (see the :code:`LICENSE.txt`
file).
Testing
-------
Testing is done with `Molecule <https://molecule.readthedocs.org/>`_. Also, this
repository has `pre-commit <http://pre-commit.com/>`_ configured.
Author Information
------------------
Nimrod Adar, `contact me <nimrod@shore.co.il>`_ or visit my `website
<https://www.shore.co.il/>`_. Patches are welcome via `git send-email
<http://git-scm.com/book/en/v2/Git-Commands-Email>`_. The repository is located
at: https://www.shore.co.il/git/.
---
# defaults file for ansible-role-openbsd-bootstrap
openbsd_pkg_mirror: http://www.mirrorservice.org/pub
---
# handlers file for ansible-role-openbsd-bootstrap
galaxy_info:
author: Nimrod Adar
description: Role to bootstrap an OpenBSD instance (allow Ansible to provision the instance).
company: Shore technologies.
license: MIT
min_ansible_version: 2.0
platforms:
- name: OpenBSD
versions:
- 5.7
- 5.8
galaxy_tags: ['OpenBSD', 'bootstrap']
dependencies: []
---
ansible:
verbose: v
retry_files_enabled: false
host_key_checking: false
molecule:
testinfra_dir: tests
vagrant:
platforms:
- name: opebsd58
box: twingly/openbsd-5.8-amd64
instances:
- name: ansible-role-openbsd-bootstrap
raw_config_args:
- 'vm.synced_folder ".", "/vagrant", disabled: true'
---
- hosts: all
gather_facts: False
roles:
- ansible-role-openbsd-bootstrap
---
# tasks file for ansible-role-openbsd-bootstrap
- name: Install Python
raw: "PKG_PATH={{ openbsd_pkg_mirror }}/OpenBSD/$(uname -r)/packages/$(arch -s)/ /usr/sbin/pkg_add -I py-pip"
register: openbsd_pkg_add_python
changed_when: "'py-pip' in openbsd_pkg_add_python.stdout"
- name: Symlink python
raw: ln -s /usr/local/bin/python2.7 /usr/bin/python
register: symlink_python
changed_when: not 'File exists' in symlink_python.stdout
failed_when: symlink_python|failed and not 'File exists' in symlink_python.stdout
- name: Gather facts
setup:
- name: Configure pkg
lineinfile:
dest: /etc/pkg.conf
line: 'installpath = {{ openbsd_pkg_mirror }}/OpenBSD/{{ ansible_distribution_release }}/packages/{{ ansible_architecture }}/'
regexp: '^installpath ='
state: present
create: yes
def test_python(Command):
assert Command('python --version').rc == 0
---
# vars file for ansible-role-openbsd-bootstrap
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment