Git Product home page Git Product logo

ansible-role-harbor-api's Introduction

[WIP] Ansible Role: Harbor API Codifying

License:MIT

An Ansible Role to manage Harbor API

Requirements

Have one or more Harbor instances

Installation

Harbor-API is an Ansible role distributed globally using Ansible Galaxy. In order to install Harbor-API role you can use the following command.

$ ansible-galaxy install leboncoin.harbor-api

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

harbor_directory_api: "{{ role_path }}/files/config/"
harbor_directory_api_projects: "{{ role_path }}/files/config/projects/"

Another variables can be used from harbor.cfg, prefixed by harbor_

harbor_auth_mode: ldap_auth
harbor_harbor_admin_password: Harbor12345

Usage

You can create json files to configure your harbor, based on swagger implementation (swagger editor)

Sysadmins

Resources:

  • Put (/users/{user_id}/sysadmin)

admins_removed is required because "harbor api" doesn't implement the research of admin #PR4388

files/config/roles.json

{
    "admins":[
        "[email protected]"
    ],
    "admins_removed":[
        "[email protected]"
    ]
}

Projects

Resources:

  • Add (/projects)
  • Put (/projects/{project_id})

files/config/projects/myproject.json

{
    "name": "myproject",
    "metadatas": {
        "public": false
    },
    "members" [
        [email protected]
    ],
    "admins": [
        [email protected]
    ]
}

Dependencies

None.

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: harbor
  roles:
     - { role: leboncoin.harbor } # install harbor instance
     - { role: leboncoin.harbor-api } # populate api

Contributing

Please, see TODO.md to get ideas to contribute or implement your own things.

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.