title: How to automate the activation of role-based strategy plugin in jenkins
body: <p>I am working to automate the installation and use of the role-based strategy plugin in Jenkins using ansible. At the moment I can easily install the plugin using the API. However, in order to use the plugin, it is necessary to activate it through the Jenkins UI by clicking '<em>Manage Jenkins</em>, then <em>Configure System</em> and selecting a role-based strategy.
  I am having difficulty automating the activation process since it seems an API does not exist in Jenkins for that. This is my relevant ansible code </p>
  
  <pre><code>- name: Install a role based plugin if it does not exist
    uri:
      url: "http://localhost:8080/pluginManager/installNecessaryPlugins"
      method: POST
      user: admin
      password: bd7afbedc842418fb7fc27fdf8b3d2e4
      force_basic_auth: yes
      body: '&lt;jenkins&gt;&lt;install plugin="role-strategy@2.9.0" /&gt;&lt;/jenkins&gt;'
      headers:
        Content-Type: "text/xml"
      follow_redirects: all  
    when: "'Role-based Authorization Strategy' not in plugins_output_list.content"
    ignore_errors: yes
  </code></pre>
  
  <p>After installing the plugin, is there a way I can activate it without using the UI? I really can't see any API for that purpose. </p>