Last active
December 19, 2018 11:47
-
-
Save williampsena/fb5b1823f6766a15ac7ea69f80b71836 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: home | |
vars: | |
host_port: 80 | |
expose_port: 9000 | |
portainer_endpoint: "http://localhost:{{ host_port }}/api" | |
tasks: | |
- name: Ensure portainer container is running | |
docker_container: | |
name: portainer_docker | |
image: portainer/portainer | |
recreate: yes | |
ports: | |
- "{{ host_port }}:{{ expose_port }}" | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- name: Configure admin user password | |
uri: | |
url: "{{ portainer_endpoint }}/users/admin/init" | |
method: POST | |
return_content: yes | |
body_format: json | |
body: { "Username": "admin", "Password": "no"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment