iknite / cookiecutter-ansible-role

Cookie cutter recipe to easily create ansible roles.
BSD 3-Clause "New" or "Revised" License
87 stars 31 forks source link

Using fork of cookiecutter #1

Closed thatarchguy closed 9 years ago

thatarchguy commented 9 years ago

post_gen_project.py is calling a cookiecutter function that is only found in this fork: https://github.com/luzfcb/cookiecutter

from cookiecutter.prompt import query_yes_no should be from cookiecutter.prompt import read_user_yes_no and the function calls changed accordingly. Note, you must provide a default_value in the call now.

def configure_role():
    print('\n\nROLE CONFIGURATION:\n===================')
    for folder_name, folder in folders.items():
        if read_user_yes_no(folder['question'], default_value=u'yes'):

            try:
                # this file has to be there, git doesn't store empty folders.
                os.remove(os.path.join(folder_name, '.empty'))
            except OSError:
                pass

            if 'hint' in folder:
                with open('{}/main.yml'.format(folder_name), 'a') as fp:

                    if 'pre_hint' in folder:
                        if read_user_yes_no(folder['pre_hint'], default_value=u'yes'):
                            fp.write(folder['pre_action'])
fjcapdevila commented 9 years ago

Same problem here.

iknite commented 9 years ago

Merged into master