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

Set a administrator password #5

Open
roumano opened this issue Mar 3, 2017 · 5 comments
Open

Set a administrator password #5

roumano opened this issue Mar 3, 2017 · 5 comments

Comments

@roumano
Copy link
Contributor

roumano commented Mar 3, 2017

Hi,

I have modify the templates/scenarios/create_hub to eventually set a administrator password :

{% if softether_master_password is defined %}
ServerPasswordSet {{softether_master_password}}
{% endif %}

It's working well on the first deployment

But it's failed on next deployment on task "Proceed with setup"
as it's type ./vpncmd localhost /server /IN:{{softether_init_script}}
and it's should be :
./vpncmd localhost /server /IN:{{softether_init_script}} /PASSWORD:{{softether_master_password|default("")}}
( with the |default("") it's also working when it's not set a password

my temporary workarround is to stop the service before deploy
but it's not a fix ...

We can replace then " - name: SoftEther | Proceed with setup"
with

shell: ./vpncmd localhost /server /IN:{{softether_init_script}} /PASSWORD:{{softether_master_password|default("")}}

but it's will failed on the first deployment as it's not yet a password set

So i'm not sure how we can handle it ...
a idea ?

@Voronenko
Copy link
Contributor

We need to perform detection, whenever instance was already initialized or this is first run

i.e. create some detection dummy script

shell: ./vpncmd localhost /server /IN:{{softether_detection_script}} /PASSWORD:{{softether_master_password}}
ignore_errors: true
register: softether_detection

and analyze softether_detection.stdout for hints, or, perhaps - this command will just return non zero on failure due to incorrect password.

than we can use later
when: softether_detection | failed

...

@roumano
Copy link
Contributor Author

roumano commented Mar 3, 2017

Sadly i have failed to do this check as even with only this scenario :

hub vpn

It's failed to connect, so the vpncmd is asking a password (with cpu usage 100% with vpncmd) so the task never finish...

i don't find any option or a trick to doing it.

@roumano
Copy link
Contributor Author

roumano commented Mar 3, 2017

Maybe need to use expect to get ride of the issue
found this on the Documentation :

  • name: Run expect to wait for a successful PXE boot via out-of-band CIMC
    shell: |
    set timeout 300
    spawn ssh admin@{{ cimc_host }}

    expect "password:"
    send "{{ cimc_password }}\n"

    expect "\n{{ cimc_name }}"
    send "connect host\n"

    expect "pxeboot.n12"
    send "\n"

    exit 0

@Voronenko
Copy link
Contributor

I tried except first with this tool - in my scenario it always hanged under ansible, while proceeding ok via raw shell

Let's keep this issue open, I will think, how to solve.

Potentially, sign of the previous install, could be the presence of the generated config on filesystem itself.....
Thus we may assume, that if config present => password is already set... Thus we would have two different init scripts - with password and w/o password.

@aivisol
Copy link

aivisol commented Jan 7, 2022

I know this is old thread but might be related: Changing softether_vpn_users variable and re running the playbook will actually not change users in the server. I deleted generated folder from the server and that helped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants