Hi,
I’m using Chef Server 12, Windows Server 2012R2 nodes.
I’m automating an off the shelf product that can only be installed in distinct separate stages.
i.e.
- Install base files and install first application then create a user account manually through a GUI.
- Install application with configs referencing account from step 1 to a certain level that then generates SQL scripts
- Once those scripts are installed and tested continue with next part of deployment.
…
Currently I’d using at the beginning of a wrapper recipe an if statement to allow it to proceed.
if node.chef_environment == ‘xxx’ and node[‘application’][‘admin_details_created’] == ‘true’ and node[‘application’][‘SQL_DBs_Created’]== ‘true’
…
But this means attributes needs updating and uploading to chef server after each portion.
I’d like to have flag files that are changed locally so the attributes etc never change. Then teams can deploy the application stack and control simply deleting / changing flag files.
e.g.
C:\chef\cache\flagfiles\ApplicationAdminACdone.txt,
C:\chef\cache\flagfiles\SQLDBsToBeCreated.txt
Then I can delete each file once task done and if those dont exist the recipe executes.
Problem
If i use Chef to create the files, chef is idompoent and will recreate the files when changed / deleted.
How can i use chef to create the files as one off processes.
Is it basically, create files, create a log file for the file creation process then add an not_if to check that log file exists?
Many thanks for anyone that can help.
David