github.com/theishshah/operator-sdk@v0.6.0/pkg/scaffold/ansible/roles_meta_main.go (about)

     1  // Copyright 2018 The Operator-SDK Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package ansible
    16  
    17  import (
    18  	"path/filepath"
    19  
    20  	"github.com/operator-framework/operator-sdk/pkg/scaffold"
    21  	"github.com/operator-framework/operator-sdk/pkg/scaffold/input"
    22  )
    23  
    24  const RolesMetaMainFile = "meta" + filePathSep + "main.yml"
    25  
    26  type RolesMetaMain struct {
    27  	input.Input
    28  	Resource scaffold.Resource
    29  }
    30  
    31  // GetInput - gets the input
    32  func (r *RolesMetaMain) GetInput() (input.Input, error) {
    33  	if r.Path == "" {
    34  		r.Path = filepath.Join(RolesDir, r.Resource.LowerKind, RolesMetaMainFile)
    35  	}
    36  	r.TemplateBody = rolesMetaMainAnsibleTmpl
    37  
    38  	return r.Input, nil
    39  }
    40  
    41  const rolesMetaMainAnsibleTmpl = `galaxy_info:
    42    author: your name
    43    description: your description
    44    company: your company (optional)
    45  
    46    # If the issue tracker for your role is not on github, uncomment the
    47    # next line and provide a value
    48    # issue_tracker_url: http://example.com/issue/tracker
    49  
    50    # Some suggested licenses:
    51    # - BSD (default)
    52    # - MIT
    53    # - GPLv2
    54    # - GPLv3
    55    # - Apache
    56    # - CC-BY
    57    license: license (GPLv2, CC-BY, etc)
    58  
    59    min_ansible_version: 2.4
    60  
    61    # If this a Container Enabled role, provide the minimum Ansible Container version.
    62    # min_ansible_container_version:
    63  
    64    # Optionally specify the branch Galaxy will use when accessing the GitHub
    65    # repo for this role. During role install, if no tags are available,
    66    # Galaxy will use this branch. During import Galaxy will access files on
    67    # this branch. If Travis integration is configured, only notifications for this
    68    # branch will be accepted. Otherwise, in all cases, the repo's default branch
    69    # (usually master) will be used.
    70    #github_branch:
    71  
    72    #
    73    # Provide a list of supported platforms, and for each platform a list of versions.
    74    # If you don't wish to enumerate all versions for a particular platform, use 'all'.
    75    # To view available platforms and versions (or releases), visit:
    76    # https://galaxy.ansible.com/api/v1/platforms/
    77    #
    78    # platforms:
    79    # - name: Fedora
    80    #   versions:
    81    #   - all
    82    #   - 25
    83    # - name: SomePlatform
    84    #   versions:
    85    #   - all
    86    #   - 1.0
    87    #   - 7
    88    #   - 99.99
    89  
    90    galaxy_tags: []
    91      # List tags for your role here, one per line. A tag is a keyword that describes
    92      # and categorizes the role. Users find roles by searching for tags. Be sure to
    93      # remove the '[]' above, if you add tags to this list.
    94      #
    95      # NOTE: A tag is limited to a single word comprised of alphanumeric characters.
    96      #       Maximum 20 tags per role.
    97  
    98  dependencies: []
    99    # List your role dependencies here, one per line. Be sure to remove the '[]' above,
   100    # if you add dependencies to this list.`