Get web proxy info in automation states


#1

Hi, All

I have a state machine that will add an EBS volume to AWS instance using direct REST API call. It works when the appliance has direct access to AWS. But when running in on appliance behind a web proxy we will have to add the web proxy info into the ruby code manually. Is there a way pull those http_proxy configuration from the Advanced configuration? We would to make the ruby script portable and not have to hard code the web proxy info.

If there is another way to add an EBS volume to AWS instance, please let me know too.

Thanks


#2

Hi @ecchong. Take a look at this similar thread and see if it answers your proxy question.

As for the EBS volume question,… @agrare would you be able to shed more light.


#3

Hi, @jprause not sure which thread you mentioned, but I found these two similar to what I asked for. However, neither provide a solution.


So, I can access the advanced configuration from the Rail console this way

irb(main):001:0> MiqServer.my_server.get_config.config[:http_proxy][:default]
=> {:host=>"192.168.1.24", :password=>nil, :port=>3128, :user=>nil}

But is it something that we can access from within the automation script?

I see the information is stored in the “settings_changes” table in the database. However, it does not look like the table is exposed to the service model and $evm.vmdb does not recognize the table. Is there another way to access the database table?

Thanks