Ansible repository with playbooks to manage azure objects
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

72 行
1.4 KiB

  1. ---
  2. - name: Login to azure
  3. command:
  4. argv:
  5. - "az"
  6. - "login"
  7. - "--service-principal"
  8. - "-u"
  9. - "{{ azure_client_id }}"
  10. - "-p"
  11. - "{{ azure_secret }}"
  12. - "-t"
  13. - "{{ azure_tenant }}"
  14. delegate_to: localhost
  15. - name: Select subscription
  16. command:
  17. argv:
  18. - "az"
  19. - "account"
  20. - "set"
  21. - "-s"
  22. - "{{ sentinel.law.subscriptionid }}"
  23. delegate_to: localhost
  24. - name: List solution
  25. command:
  26. argv:
  27. - "az"
  28. - "resource"
  29. - "list"
  30. - "--resource-type"
  31. - "Microsoft.OperationsManagement/solutions"
  32. - "--name"
  33. - "{{ sentinel.law.name | default('', true) }}"
  34. register: azure_sentinel_facts
  35. delegate_to: localhost
  36. - name: Push arm template
  37. template:
  38. src: "sentinel.json.j2"
  39. dest: "/tmp/sentinel.json"
  40. delegate_to: localhost
  41. - name: Validate template
  42. command:
  43. argv:
  44. - "az"
  45. - "group"
  46. - "deployment"
  47. - "validate"
  48. - "-g"
  49. - "{{ sentinel.resource_group }}"
  50. - "--template-file"
  51. - "/tmp/sentinel.json"
  52. delegate_to: localhost
  53. - name: Create sentinel solution
  54. command:
  55. argv:
  56. - "az"
  57. - "group"
  58. - "deployment"
  59. - "create"
  60. - "-g"
  61. - "{{ sentinel.resource_group }}"
  62. - "--template-file"
  63. - "/tmp/sentinel.json"
  64. register: createsentinel
  65. delegate_to: localhost
  66. ...