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

docker_plugin driver options not configure plugin #118

Closed
smirninini opened this issue Apr 5, 2021 · 3 comments · Fixed by #135
Closed

docker_plugin driver options not configure plugin #118

smirninini opened this issue Apr 5, 2021 · 3 comments · Fixed by #135
Labels
docker-plain plain Docker (no swarm, no compose, no stack)

Comments

@smirninini
Copy link

smirninini commented Apr 5, 2021

SUMMARY

Like in example below in official documentation , there will no be any params in config through plugin_options

docker plugin inspect weaveworks/net-plugin:latest_release | grep PASSWORD

 "Name": "WEAVE_PASSWORD",
 "WEAVE_PASSWORD=",
- name: Install a plugin with options
  community.docker.docker_plugin:
    name: weaveworks/net-plugin:latest_release
    plugin_options:
      IPALLOC_RANGE: "10.32.0.0/12"
      WEAVE_PASSWORD: "PASSWORD"
ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.docker.docker_plugin

ANSIBLE VERSION
2.10.7
CONFIGURATION

OS / ENVIRONMENT

Ubuntu 20.04

STEPS TO REPRODUCE
- name: Install a plugin
      community.docker.docker_plugin:
        plugin_name: "vieux/sshfs"
        plugin_options:
          sshkey.source: "/tmp/.ssh/"
        state: enable
EXPECTED RESULTS

docker plugin inspect vieux/sshfs

.....
            ],
            "Mounts": [
                {
                    "Description": "",
                    "Destination": "/mnt/state",
                    "Name": "state",
                    "Options": [
                        "rbind"
                    ],
                    "Settable": [
                        "source"
                    ],
                    "Source": "/var/lib/docker/plugins/",
                    "Type": "bind"
                },
                {
                    "Description": "",
                    "Destination": "/root/.ssh",
                    "Name": "sshkey",
                    "Options": [
                        "rbind"
                    ],
                    "Settable": [
                        "source"
                    ],
                    "Source": "/tmp/.ssh/",
                    "Type": "bind"
                }
            ]
        }
    }
]
ACTUAL RESULTS

docker plugin inspect vieux/sshfs

.......
              },
                {
                    "Description": "",
                    "Destination": "/root/.ssh",
                    "Name": "sshkey",
                    "Options": [
                        "rbind"
                    ],
                    "Settable": [
                        "source"
                    ],
                    "Source": "",
                    "Type": "bind"
                }
            ]
        }
    }
]

@felixfontein felixfontein added the docker-plain plain Docker (no swarm, no compose, no stack) label Apr 6, 2021
@felixfontein
Copy link
Collaborator

Can you try running the task two times, and see whether that helps?

From looking at the code, I guess we also need to run self.existing_plugin.configure(prepare_options(self.parameters.plugin_options)) in install_plugin(). If you run the module twice, it should update the config though.

@felixfontein
Copy link
Collaborator

@pavlentio can you please check what I wrote above?

@felixfontein
Copy link
Collaborator

resolved_by_pr #135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker-plain plain Docker (no swarm, no compose, no stack)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants