Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create vultr_server_metal.py for working with baremetal servers #52437

Open
wants to merge 3 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@vitikc
Copy link

vitikc commented Feb 18, 2019

Create and destroy baremetal servers on Vultr.

SUMMARY
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

Create and destroy baremetal servers on Vultr.

ADDITIONAL INFORMATION

This feature was very important to work with my project and we decided to make own module. This module based on vultr_server.py but has only supported functionality (Only create and destroy server available)


Create vultr_server_metal.py
Create and destroy baremetal servers on Vultr.
@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Feb 18, 2019

Update vultr_server_metal.py
Documentation changes
@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Feb 18, 2019

The test ansible-test sanity --test ansible-doc --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/vultr/vultr_server_metal.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/vultr/vultr_server_metal.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/cloud/vultr/vultr_server_metal.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/vultr/vultr_server_metal.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/vultr/vultr_server_metal.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/cloud/vultr/vultr_server_metal.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test docs-build [explain] failed with the error:

Command "/usr/bin/python test/sanity/code-smell/docs-build.py" returned exit status 1.
>>> Standard Error
Command 'make singlehtmldocs' failed with status code: 2
--> Standard Output
cat _themes/srtd/static/css/theme.css | sed -e 's/^[ 	]*//g; s/[ 	]*$//g; s/\([:{;,]\) /\1/g; s/ {/{/g; s/\/\*.*\*\///g; /^$/d' | sed -e :a -e '$!N; s/\n\(.\)/\1/; ta' > _themes/srtd/static/css/theme.min.css
PYTHONPATH=../../lib ../bin/dump_config.py --template-file=../templates/config.rst.j2 --output-dir=rst/reference_appendices/ -d ../../lib/ansible/config/base.yml
mkdir -p rst/cli
PYTHONPATH=../../lib ../bin/generate_man.py --template-file=../templates/cli_rst.j2 --output-dir=rst/cli/ --output-format rst ../../lib/ansible/cli/*.py
PYTHONPATH=../../lib ../bin/dump_keywords.py --template-dir=../templates --output-dir=rst/reference_appendices/ -d ./keyword_desc.yml
PYTHONPATH=../../lib ../bin/plugin_formatter.py -t rst --template-dir=../templates --module-dir=../../lib/ansible/modules -o rst/modules/ 
Evaluating module files...
Makefile:93: recipe for target 'modules' failed
--> Standard Error
Traceback (most recent call last):
  File "../bin/plugin_formatter.py", line 774, in <module>
    main()
  File "../bin/plugin_formatter.py", line 729, in main
    plugin_info, categories = get_plugin_info(options.module_dir, limit_to=options.limit_to, verbose=(options.verbosity > 0))
  File "../bin/plugin_formatter.py", line 294, in get_plugin_info
    doc, examples, returndocs, metadata = plugin_docs.get_docstring(module_path, fragment_loader, verbose=verbose)
  File "/root/ansible/lib/ansible/utils/plugin_docs.py", line 103, in get_docstring
    data = read_docstring(filename, verbose=verbose, ignore_errors=ignore_errors)
  File "/root/ansible/lib/ansible/parsing/plugin_docs.py", line 59, in read_docstring
    data[varkey] = AnsibleLoader(child.value.s, file_name=filename).get_single_data()
  File "/usr/local/lib/python3.6/dist-packages/yaml/constructor.py", line 35, in get_single_data
    node = self.get_single_node()
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.6/dist-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/usr/local/lib/python3.6/dist-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/local/lib/python3.6/dist-packages/yaml/parser.py", line 439, in parse_block_mapping_key
    "expected <block end>, but found %r" % token.id, token.start_mark)
yaml.parser.ParserError: while parsing a block mapping
  in "<unicode string>", line 3, column 1:
    module: vultr_server_metal
    ^
expected <block end>, but found '<block mapping start>'
  in "<unicode string>", line 57, column 2:
     state:
     ^
make: *** [modules] Error 1

The test ansible-test sanity --test validate-modules [explain] failed with 5 errors:

lib/ansible/modules/cloud/vultr/vultr_server_metal.py:0:0: E324 Argument 'api_account' in argument_spec defines default as ('default') but documentation defines default as (None)
lib/ansible/modules/cloud/vultr/vultr_server_metal.py:0:0: E324 Argument 'state' in argument_spec defines default as ('present') but documentation defines default as (None)
lib/ansible/modules/cloud/vultr/vultr_server_metal.py:0:0: E324 Argument 'validate_certs' in argument_spec defines default as (True) but documentation defines default as (False)
lib/ansible/modules/cloud/vultr/vultr_server_metal.py:0:0: E326 Argument 'state' in argument_spec defines choices as (['present', 'absent']) but documentation defines choices as ([])
lib/ansible/modules/cloud/vultr/vultr_server_metal.py:70:2: E302 DOCUMENTATION is not valid YAML

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

lib/ansible/modules/cloud/vultr/vultr_server_metal.py:70:2: error DOCUMENTATION: syntax error: expected <block end>, but found '<block mapping start>'

click here for bot help

@resmo

This comment has been minimized.

Copy link
Member

resmo commented Feb 18, 2019

cool thing! Did you notice there are integration tests in https://github.com/ansible/ansible/tree/devel/test/integration/targets? Also see to get started https://docs.ansible.com/ansible/devel/scenario_guides/guide_vultr.html#integration-tests

Would you have time to add test for this module? Let me know if I can help or you con't have time, so the community can take over for the tests.

use_cache=True
)

def get_ssh_key(self):

This comment has been minimized.

@resmo

resmo Feb 18, 2019

Member

we recently fixed this in vultr_server to be able to pass multiple keys. See #50337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.