1. 01 Nov, 2021 5 commits
    • Michal Arbet's avatar
      Release to unstable · 52a204bf
      Michal Arbet authored
      52a204bf
    • Michal Arbet's avatar
      Fix d/p/install-missing-files.patch · e982c4d4
      Michal Arbet authored
      e982c4d4
    • Michal Arbet's avatar
    • Michal Arbet's avatar
      Bump dynaconf version · 017eae43
      Michal Arbet authored
      017eae43
    • Michal Arbet's avatar
      Merge tag '1.5.7' into debian/xena · 05b39585
      Michal Arbet authored
      1.5.7
      
      This is the 1.5.7 stable release of ara.
      
      It features a new "hosts" page to browse and search playbook reports by host
      as well as fixes and improvements.
      
      Instructions for upgrading are included in the upgrade notes.
      
      Changes since 1.5.6:
      
      UI
      --
      
      - Added a new "hosts" page to browse and search reports by host name
      - Improved page HTML titles to be dynamic based on the context
      - Added a note highlighting if a task has been delegated to another host
        (https://github.com/ansible-community/ara/issues/282)
      - Improved how long file paths or playbook names are truncated and displayed
      
      API
      ---
      
      - Added a new read-only API endpoint: /api/v1/latesthosts
        It provides the latest playbook result for each host name.
        Under the hood, it implements the machinery for updating the latest host
        every time a host is created or deleted and includes a SQL migration to
        initially populate a new database table with the latest hosts.
      - Added a `delegated_to` field to results in order to record a host id to which
        a task has been delegated.
      - Added support for finding results delegated to a specific host:
        /api/v1/results?delegated_to=<host_id>
      
      Callback plugin
      ---------------
      
      - Fixed tasks and results being recorded out of order when using "strategy: free"
        (https://github.com/ansible-community/ara/issues/260)
      - Added support for recording 'delegate_to' on tasks
      
      Documentation
      -------------
      
      - Removed an unused sphinx lexer to allow recent versions of sphinx>=4
      - Created a new troubleshooting guide with common issues:
        https://ara.readthedocs.io/en/latest/troubleshooting.html
      - Added a database relationship graph to the endpoint documentation:
        https://ara.readthedocs.io/en/latest/api-documentation.html#relationship-between-objects
      
      Upgrade notes
      -------------
      
      It is always recommended to take a backup of your database before upgrading.
      
      This release includes two database migrations that must be run:
      - One for populating the data for the new /api/v1/latesthosts endpoint as well
        as the new 'hosts' page
      - One for adding a `delegated_to` field in the results.
        Note that delegated tasks will only be recorded as such from 1.5.7 on.
      
      After upgrading to 1.5.7, database migrations can be run manually with the
      `ara-manage migrate` command if they are not taken care of automatically by the
      callback plugin.
      
      Known issues
      ------------
      
      ara will not record task delegation for tasks that are skipped or for
      items in a loop that are skipped because Ansible doesn't provide the
      necessary information in those cases.
      05b39585
  2. 31 Jul, 2021 3 commits
  3. 30 Jul, 2021 1 commit
  4. 29 Jul, 2021 4 commits
    • David Moreau-Simard's avatar
      callback: skip recording delegate_to for skipped loop items · 0302e632
      David Moreau-Simard authored
      8df13a99 avoided recording tasks with
      delegate_to that had been skipped entirely due to a 'when' condition
      because Ansible doesn't template the variable sent to the callback.
      
      It turns out that we also need to avoid recording it for skipped items
      while in a loop because the delegate_to also doesn't get templated by
      Ansible.
      0302e632
    • David Moreau-Simard's avatar
      tests - refactor playbook integration tests for delegate_to · 3f2b985d
      David Moreau-Simard authored
      It looks like there are many different cases to test and validate and
      what started as a simple enough approach doesn't cut it.
      
      Refactor it a bit to make it a bit more modular.
      3f2b985d
    • David Moreau-Simard's avatar
      callback: don't record delegate_to if the task was skipped · 8df13a99
      David Moreau-Simard authored
      When delegate_to is a variable and the task is skipped, Ansible doesn't
      template the variable before sending it to the callback.
      
      We can afford to work around this for skipped tasks.
      8df13a99
    • David Moreau-Simard's avatar
      api: Update LatestHost when deleting a playbook · 16461f6b
      David Moreau-Simard authored
      We have a custom perform_destroy that runs when deleting a host via the
      API (DELETE /api/v1/hosts/<id>) that takes care of updating the
      latesthost entry.
      
      However, because hosts get deleted via the database model
      (on_delete=models.CASCADE) when deleting a playbook via the API, the
      latesthost entry would get deleted when the host was deleted instead of
      being updated.
      
      This adds a very similar perform_destroy for playbooks that iterates
      over the hosts and if one of the hosts happens to be a LatestHost, it
      will update the entry before deleting.
      16461f6b
  5. 28 Jul, 2021 2 commits
    • David Moreau-Simard's avatar
      api/callback/ui: Re-implement delegate_to task recording · 973c138d
      David Moreau-Simard authored
      After testing the initial implementation in production, it had two issues:
      1) A task could potentially be delegated to more than a single host if
         delegate_to is a variable provided by a loop (ex: {{ item }})
      2) Inside the callback, result._task.delegate_to could return a variable
         instead of a value when the task is a loop.
         See ansible/ansible issue #75339 for details.
      
      We're addressing the first issue by changing the model and API to expect
      delegated_to to be a list -- even if it's empty or just one item.
      
      For the second issue, we found that the value of delegate_to is properly
      templated for a task loop from within the v2_runner_item_on_* callback
      hooks. The callback was adjusted to leverage these item hooks to get the
      proper list of delegated host names.
      973c138d
    • David Moreau-Simard's avatar
      api/ui: restore filtering on latesthost & add nested date filtering · 9a776800
      David Moreau-Simard authored
      commit 982f1a84 made it so we could no
      longer filter by created or updated for LatestHost which made it
      inconsistent with all the other endpoints.
      
      This adds host__ fields to filter on the nested host fields instead.
      9a776800
  6. 27 Jul, 2021 5 commits
  7. 26 Jul, 2021 4 commits
    • David Moreau-Simard's avatar
      api: rename distincthosts to latesthosts · 7c0917c6
      David Moreau-Simard authored
      This has no incidence on functionality and is just a name change intended
      to clarify and streamline the meaning and vocabulary around the feature.
      
      Depending on the context, the words "latest" and "distinct" could have
      different meanings or be used interchangeably.
      
      Instead of having the notion of a DistinctHost which has a "latest"
      that in reality is a "host", do away with the potential confusion and
      name it LatestHost with a "host" reference instead of "latest".
      7c0917c6
    • David Moreau-Simard's avatar
      ui: Fix page titles when using static generation · 7c5988ae
      David Moreau-Simard authored
      The index and host_index templates relied on pagination data to provide
      context in the page titles. These turned out empty when doing static
      generation since there is no pagination there.
      7c5988ae
    • David Moreau-Simard's avatar
      ui: First iteration of the new host index (#206) · 08fa649d
      David Moreau-Simard authored
      This adds a new index page for hosts, analogous to the index page for playbooks.
      Instead of browsing and searching through playbooks, it is now possible to do it
      for hosts.
      
      By default, it will list only the latest report for each host (made possible by
      the recent addition of /api/v1/distincthosts) and includes a toggle to list all
      reports for every host.
      08fa649d
    • David Moreau-Simard's avatar
      ui: Change page title dynamically to provide context · a95de7ce
      David Moreau-Simard authored
      The page title was always "ARA Records Ansible" which made it harder to
      distinguish particular pages across multiple tabs.
      
      The new titles provide a bit of context and provide summary information.
      Uncapitalizing ARA because it's another recursive acronym and the
      current logo doesn't capitalize the "ara".
      a95de7ce
  8. 24 Jul, 2021 1 commit
    • David Moreau-Simard's avatar
      api/callback/ui: Add support for tracking task delegation · 98849f29
      David Moreau-Simard authored
      ara did not previously record whether or not a task had been delegated
      and if so, to which host. Now it does.
      
      This adds a field for it in the result model so we can display it when
      browsing a result's details.
      
      From an API perspective, it also adds support for searching results that
      may have been delegated to a particular host ID like so:
          /api/v1/results?delegated_to=<id>
      98849f29
  9. 23 Jul, 2021 2 commits
    • David Moreau-Simard's avatar
      tests: Add integration test for free strategy · b2d998f1
      David Moreau-Simard authored
      This ensures that ara records tasks and results properly, even when
      using the free strategy.
      b2d998f1
    • Jared Hampson's avatar
      Add caching for tasks in callback plugin (#268) · b72261d5
      Jared Hampson authored
      When running a playbook with free strategy, multiple hosts could be running
      different playbook tasks at the same time.
      
      This caused ARA to associate results to the wrong task id, resuting in task
      names not matching the task result in the ARA web interface.
      
      Now, the task is cached by it's uuid. The task result includes the task uuid, so
      this is used to ensure the correct task id is associate with a particular result.
      b72261d5
  10. 21 Jul, 2021 2 commits
  11. 20 Jul, 2021 1 commit
  12. 19 Jul, 2021 1 commit
  13. 16 Jul, 2021 1 commit
    • David Moreau-Simard's avatar
      docs: Add a database model graph · 58a5ee30
      David Moreau-Simard authored
      This is an addition to help flesh out the docs about relationships
      between objects and a quick win since it works out of the box with
      django_extensions' graph_models.
      
      Since the database model doesn't move very much, it's rendered a single
      time manually (instead of, say, automatically after every commit) and
      there are instructions included to generate it again, if need be, in order
      to avoid adding django_extensions as a dependency.
      58a5ee30
  14. 14 Jul, 2021 2 commits
  15. 01 Jun, 2021 3 commits
  16. 20 Apr, 2021 2 commits
  17. 19 Apr, 2021 1 commit