{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/autoheal/issues/6","repository_url":"https://api.github.com/repos/openshift/autoheal","labels_url":"https://api.github.com/repos/openshift/autoheal/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/openshift/autoheal/issues/6/comments","events_url":"https://api.github.com/repos/openshift/autoheal/issues/6/events","html_url":"https://github.com/openshift/autoheal/pull/6","id":308531903,"number":6,"title":"Read configuration from yaml file","user":{"login":"jhernand","id":1423971,"avatar_url":"https://avatars3.githubusercontent.com/u/1423971?v=4","gravatar_id":"","url":"https://api.github.com/users/jhernand","html_url":"https://github.com/jhernand","followers_url":"https://api.github.com/users/jhernand/followers","following_url":"https://api.github.com/users/jhernand/following{/other_user}","gists_url":"https://api.github.com/users/jhernand/gists{/gist_id}","starred_url":"https://api.github.com/users/jhernand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhernand/subscriptions","organizations_url":"https://api.github.com/users/jhernand/orgs","repos_url":"https://api.github.com/users/jhernand/repos","events_url":"https://api.github.com/users/jhernand/events{/privacy}","received_events_url":"https://api.github.com/users/jhernand/received_events","type":"User","site_admin":false},"labels":[{"id":876360891,"url":"https://api.github.com/repos/openshift/autoheal/labels/size/XXL","name":"size/XXL","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2018-03-26T11:22:54Z","updated_at":"2018-03-27T18:54:40Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/openshift/autoheal/pulls/6","html_url":"https://github.com/openshift/autoheal/pull/6","diff_url":"https://github.com/openshift/autoheal/pull/6.diff","patch_url":"https://github.com/openshift/autoheal/pull/6.patch"},"body":"This patch changes the auto-heal service so that it reads the\r\nconfiguration from a `autoheal.yml` configuration from a YAML file,\r\nincluding the set of rules that used to be obtained with a Kubernetes\r\nAPI query.\r\n\r\nAn example configuration file looks like this:\r\n\r\n```yaml\r\n#\r\n# This section contains the details needed to connect to the AWX or Ansible\r\n# Tower server that will execute the Ansible playbooks.\r\n#\r\nawx:\r\n  #\r\n  # The URL of the AWX API endpoint, including the `/api` suffix, but not the\r\n  # `/v1` or `/v2` suffixes.\r\n  #\r\n  address: https://my-awx.example.com/api\r\n\r\n  #\r\n  # The URL of the proxy servere to use to connect to the AWX API. If not\r\n  # present or empty then no proxy server will be used.\r\n  #\r\n  proxy: http://my-proxy.example.com:3128\r\n\r\n  #\r\n  # Reference to the Kubernetes secret that contains the user name and password\r\n  # to use to connect to the AWX API.\r\n  #\r\n  credentialsRef:\r\n    namespace: my-namespace\r\n    name: my-awx-credentials\r\n\r\n  #\r\n  # Reference to the Kubernetes secret that contains the TLS certificates and\r\n  # keys to use to connect to the AWX API. Usually this will connect only the\r\n  # `ca.crt` entry, which should contain the PEM encoded certificates of the\r\n  # authorities that will be trusted when verifying the certificates presented\r\n  # by the AWX server. If not present or empty then the global system trusted\r\n  # certificates will be used.\r\n  #\r\n  tlsRef:\r\n    namespace: my-namespace\r\n    name: my-awx-tls\r\n\r\n  #\r\n  # The name of the AWX project that contains the auto-heal job templates.\r\n  #\r\n  project: \"My project\"\r\n\r\n#\r\n# This section contains the healing rules.\r\n#\r\nrules:\r\n\r\n#\r\n# This rule runs an the `Start Node` AWX job when the `NodeDown` alert\r\n# is fired. The playbook that handles this alert is expected to take the\r\n# name of the down from the `node` variable, so we need to translate the\r\n# `instance` label into the `node` variable passed in the `extraVars`.\r\n#\r\n- metadata:\r\n    name: start-node\r\n  labels:\r\n    alertname: \"NodeDown\"\r\n  awxJob:\r\n    template: \"Start node\"\r\n    extraVars: |-\r\n      {\r\n        \"node\": \"{{ $labels.instance }}\"\r\n      }\r\n\r\n#\r\n# This rule runs a batch job that uses Python to say hello when the\r\n# `NewFriend` alert is fired. The alert is expected to have a `name`\r\n# label containing the name of the new friend.\r\n#\r\n- metadata:\r\n    name: say-hello\r\n  labels:\r\n    alertname: \"NewFriend\"\r\n  batchJob:\r\n    apiVersion: batch/v1\r\n    kind: Job\r\n    metadata:\r\n      namespace: default\r\n      name: hello\r\n    spec:\r\n      template:\r\n        spec:\r\n          containers:\r\n          - name: python\r\n            image: python\r\n            command:\r\n            - python\r\n            - -c\r\n            - print(\"Hello {{ $labels.name }}!\")\r\n          restartPolicy: Never\r\n```"},"comment":{"url":"https://api.github.com/repos/openshift/autoheal/issues/comments/376635954","html_url":"https://github.com/openshift/autoheal/pull/6#issuecomment-376635954","issue_url":"https://api.github.com/repos/openshift/autoheal/issues/6","id":376635954,"user":{"login":"ironcladlou","id":298299,"avatar_url":"https://avatars0.githubusercontent.com/u/298299?v=4","gravatar_id":"","url":"https://api.github.com/users/ironcladlou","html_url":"https://github.com/ironcladlou","followers_url":"https://api.github.com/users/ironcladlou/followers","following_url":"https://api.github.com/users/ironcladlou/following{/other_user}","gists_url":"https://api.github.com/users/ironcladlou/gists{/gist_id}","starred_url":"https://api.github.com/users/ironcladlou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironcladlou/subscriptions","organizations_url":"https://api.github.com/users/ironcladlou/orgs","repos_url":"https://api.github.com/users/ironcladlou/repos","events_url":"https://api.github.com/users/ironcladlou/events{/privacy}","received_events_url":"https://api.github.com/users/ironcladlou/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T18:54:40Z","updated_at":"2018-03-27T18:54:40Z","author_association":"MEMBER","body":"Did you put the `ignored` statement at the top (i.e. before any `constraint`s)? That's important. If the ignore is effective, `tools` should be ignored complete by `dep`.\r\n\r\nI'll spent some more time on this tomorrow. We may have to experiment with `required` or something. It's a mess. "}}
{"actor":{"display_login":"ironcladlou"}}