ansible / ansible-container-demo

Manage the application lifecycle from development to deployment using Ansible Container
61 stars 32 forks source link

ansible-container init ansible.django-gulp-nginx fails #7

Open klauern opened 6 years ago

klauern commented 6 years ago

I can't download this role using the guide:

 ansible-container init ansible.django-gulp-nginx
ERROR   Unknown exception
Traceback (most recent call last):
  File "/home/klauer/.local/lib/python2.7/site-packages/container/cli.py", line 299, in __call__
    getattr(core, u'hostcmd_{}'.format(args.subcommand))(**vars(args))
  File "/home/klauer/.local/lib/python2.7/site-packages/container/__init__.py", line 28, in __wrapped__
    return fn(*args, **kwargs)
  File "/home/klauer/.local/lib/python2.7/site-packages/container/core.py", line 75, in hostcmd_init
    e))
RequestException: Could not find 'ansible.django-gulp-nginx' on Galaxy server 'https://galaxy.ansible.com/': HTTPError(u'400 Client Error: Bad Request for url: https://galaxy.ansible.com/api/v1/roles/?namespace=ansible&name=django-gulp-nginx&role_type=APP',)
akatbo commented 6 years ago

@klauern were you ever assisted on this issue?? am experiancing the same issue with ansible-container init ansible.django-gulp-nginx

klauern commented 6 years ago

Hello @akatbo,

No, I haven't been digging into this recently. Once our team gets a containerized environment set up, though, we will be digging into this a lot more, and hoping we can find some good tutorials and demos to experiment with. So far, this hasn't changed

tshalif commented 6 years ago

A workaround is to run ansible-container init 1448.django-gulp-nginx.

It seems Ansible Galaxy is expecting the namespace to be an int value (Unless there is a bug in the code running Ansible Galaxy itself):

curl 'https://galaxy.ansible.com/api/v1/roles/?namespace=ansible&name=django-gulp-nginx&role_type=APP'

results in:

{"detail":"invalid literal for int() with base 10: 'ansible'"}

Whereas if you specify namespace=1448 (or omit the namespace=ansible):

curl 'https://galaxy.ansible.com/api/v1/roles/?namespace=1448&name=django-gulp-nginx&role_type=APP'

You get a result:

{
   "next_link" : null,
   "next" : null,
   "count" : 1,
   "previous_link" : null,
   "results" : [
      {
         "id" : 25128,
         "is_valid" : true,
         "min_ansible_version" : null,
         "issue_tracker_url" : "https://github.com/ansible/django-gulp-nginx/issues",
         "imported" : "2018-10-04T06:11:28.052479-04:00",
         "license" : "Apache",
         "name" : "django-gulp-nginx",
         "github_user" : "ansible",
         "modified" : "2018-10-04T10:11:28.052627Z",
         "github_repo" : "django-gulp-nginx",
         "created" : "2018-04-18T08:38:53.692144Z",
         "commit_url" : "https://api.github.com/repos/ansible/django-gulp-nginx/git/commits/fc1b90b623107d6253f982ea99de6a782aea6d5d",
         "role_type" : "APP",
         "description" : "Ansible Container Django demo",
         "travis_status_url" : "https://travis-ci.org/ansible/django-gulp-nginx.svg?branch=master",
         "open_issues_count" : 3,
         "active" : true,
         "related" : {
            "imports" : "/api/v1/roles/25128/imports/",
            "dependencies" : "/api/v1/roles/25128/dependencies/",
            "content_type" : "/api/v1/content_types/11/"
         },
         "company" : "Ansible by Red Hat",
         "stargazers_count" : 15,
         "download_count" : 216,
         "commit_message" : "Fix static copying",
         "commit" : "fc1b90b623107d6253f982ea99de6a782aea6d5d",
         "github_branch" : "master",
         "summary_fields" : {
            "videos" : [],
            "versions" : [],
            "platforms" : [],
            "tags" : [],
            "repository" : {
               "forks_count" : 9,
               "format" : "role",
               "travis_status_url" : "https://travis-ci.org/ansible/django-gulp-nginx.svg?branch=master",
               "travis_build_url" : "https://travis-ci.org/ansible/django-gulp-nginx/builds/398154727",
               "name" : "django-gulp-nginx",
               "original_name" : "django-gulp-nginx",
               "stargazers_count" : 15,
               "id" : 50330,
               "open_issues_count" : 3,
               "watchers_count" : 9
            },
            "provider_namespace" : {
               "id" : 1434,
               "name" : "ansible"
            },
            "dependencies" : [],
            "content_type" : {
               "name" : "role",
               "description" : "Role",
               "id" : 11
            },
            "namespace" : {
               "avatar_url" : "https://avatars2.githubusercontent.com/u/1507452?v=4",
               "is_vendor" : false,
               "id" : 1448,
               "company" : null,
               "location" : null,
               "name" : "ansible",
               "email" : null,
               "html_url" : "https://github.com/ansible"
            }
         },
         "url" : "/api/v1/roles/25128/",
         "forks_count" : 9
      }
   ],
   "previous" : null
}
dsuth1 commented 6 years ago

This still hasn't been addressed.