How can I find which role my fabfile is executing under in a task? - fabric

In the command line I do:
fab task -Rproduction
Is there a hook that lets me find out what role I'm executing under in the task?

The answer is "not until 2.0"
https://github.com/fabric/fabric/pull/824

Related

AWS Copilot pipeline fails, why cant CodeBuild find buildspec.yml?

I created an aws Copilot pipeline but it fails because CodeBuild says it can't find buildspec.yml.
I'm not sure where the beginning of the path comes from /codebuild/output/src1#####3/src/ however the second part of the path is exactly correct /copilot/pipelines/projectname-master/buildspec.yml
How can I troubleshoot why this file cannot be found?
Note: this was set up using the copilot pipeline init cli command
I believe the problem is related to a bug surfaced here: https://github.com/aws/copilot-cli/issues/3468, which has been fixed with https://github.com/aws/copilot-cli/pull/3532 and released just this morning – please update Copilot to v1.18.0.

How to add a shell script after AWS EMR has started

Currently, I am using a transient cluster, whenever my shell script encounters a failure in "add_step", it shuts down. I have started an EMR to debug this, but don't know where to add and test my script after it has launched.
I clicked on the steps and selected "Custom Jar" and
If I give my shell script in the S3 path as shown in the below screenshot. It fail's. How can I execute the script when EMR is running.
Thanks,
Xi
Here are the detailed steps on how to add
https://emr-etl.workshop.aws/spark_etl/steps.html

AWS CDK - how does one debug a hanging deploy?

There are times when I run cdk deploy and it will get to creating a ECS service and just hang because I did "something" wrong with my config --
55/57 Currently in progress: MyServiceFA17513E
Is there any way to get insight into what the problem is? It seems to take quite long to timeout (hour+?)
You can run your command with the verbose parameter to get more details
cdk deploy -vv

How to run a script on a Google Compute Instance?

You can run a startup-script and a shutdown-script, but is it possible to use the Compute Engine API to run a script after startup?
The primary reason I'm asking is because the startup script isn't executing for me upon first run
Yes, this can be done. You can pass the file through a gcloud command or just add it to the instance metadata using the UI. Take a look at the following documentation for startup-script and shutdown-script.

Is it possible to run an Ansible playbook from a Chef AWS/Opworks cookbook?

I try to figure out if it's possible to create a Chef cookbook that ssh into an Ansible server and run some Ansible cookbook from AWS Opworks on the current node
I think of a script that I can put in a execute like this :
define :foobar_magento2_deploy do
release_path = node[:app_release_path]
execute 'Ansible playbook' do
command "ssh -i key ansible-server 'ansible-playbook arg1 arg2'"
end
end
Do you think it's possible ? Is there some caveats ? Hints ?
Edit from #coderanger answer:
define :foobar_magento2_deploy do
release_path = node[:app_release_path]
execute 'Ansible playbook' do
command "git clone ansible-playbook"
command "cd ansible-playbook"
command "ansible-playbook -l localhost playbook.yml"
end
end
So a couple of things:
OpsWorks Stacks is dangerously out of date and using it should be considered highly suspect.
I don't actually recognize that define block thing in there, maybe that's an older OpsWorks syntax?
You can definitely run an Ansible playbook from Chef code, but I would probably go a little simpler than you have there. Probably just run ansible-playbook locally and aim it at localhost.