Skip to content

Commit

Permalink
Exclude - (hyphen) from password (#30)
Browse files Browse the repository at this point in the history
* Exclude - from root_password

* _ is also OK in the beginning of a kickstart pw

* Removed superfluous hexdigits

It's part of digits and ascii_letters (which are functions in the
python strings library)
  • Loading branch information
martbhell authored and oscarkraemer committed Mar 21, 2019
1 parent faf6e75 commit f9d0346
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ env_virt_install: {}
#networks:
# - "network --onboot=on --device=eth0 --bootproto=static --ip=VM_IP --netmask=VM_NETMASK --gateway=VM_GATEWAY --nameserver=NAMESERVER --hostname=VM_HOSTNAME"

# Root password in kickstart format
#root_password: "{{ lookup('password', 'credentials/'+ inventory_hostname +'_rootpw length=15') }}"
# Root password in kickstart format, only including letters, numbers and . and _ and ,
# Don't want password to start with "-" because kickstart/anaconda dislike that.
#root_password: "{{ lookup('password', 'credentials/'+ inventory_hostname +'_rootpw length=15 chars=ascii_letters,digits,.,_,,') }}"

# If you want to define a specific CPU model
#virt_install_cpu_model:
Expand Down
2 changes: 1 addition & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
- bridges: [ "br-example" ]
- fqdn: "localhost"
- install_url: "http://www.nic.funet.fi/pub/Linux/INSTALL/Centos/7/os/x86_64/"
- root_password: "changemeorperish"
- root_password: "{{ lookup('password', 'credentials/'+ inventory_hostname +'_rootpw length=15 chars=ascii_letters,digits,hexdigits,.,_,,') }}"

roles:
- ansible-role-provision-vm
Expand Down

0 comments on commit f9d0346

Please sign in to comment.