Add default password for server.
This commit is contained in:
parent
891ea2a47b
commit
3d419366c4
@ -4,3 +4,4 @@
|
|||||||
server_host: none
|
server_host: none
|
||||||
portainer_config: /tmp/config
|
portainer_config: /tmp/config
|
||||||
portainer_port: "8000"
|
portainer_port: "8000"
|
||||||
|
portainer_password: "changeme"
|
@ -1,6 +1,22 @@
|
|||||||
---
|
---
|
||||||
# tasks file for portainer role
|
# tasks file for portainer role
|
||||||
|
|
||||||
|
#
|
||||||
|
# Set up the admin password
|
||||||
|
#
|
||||||
|
- name: Make sure htpasswd is installed
|
||||||
|
apt:
|
||||||
|
name: apache2-utils
|
||||||
|
state: present
|
||||||
|
when: inventory_hostname == server_host and server_host and server_host != "none"
|
||||||
|
|
||||||
|
- name: Create bcrypt password
|
||||||
|
shell:
|
||||||
|
cmd: |
|
||||||
|
htpasswd -nb -B admin "{{ portainer_password }}" | cut -d ":" -f 2
|
||||||
|
register: portainer_password_bcrypt
|
||||||
|
when: inventory_hostname == server_host and server_host and server_host != "none"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Install portainer server on the server host
|
# Install portainer server on the server host
|
||||||
#
|
#
|
||||||
@ -27,6 +43,7 @@
|
|||||||
volumes:
|
volumes:
|
||||||
- "/var/run/docker.sock:/var/run/docker.sock"
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
||||||
- "{{ portainer_config }}:/data"
|
- "{{ portainer_config }}:/data"
|
||||||
|
command: [ "--admin-password", "'{{ portainer_password_bcrypt.stdout }}'"]
|
||||||
when: inventory_hostname == server_host and server_host and server_host != "none"
|
when: inventory_hostname == server_host and server_host and server_host != "none"
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user