Sha256: 0223e85517995d0ce1d0e832cb5b1a43733d0fe3713bac33fdb3a4973757e146

Contents?: true

Size: 535 Bytes

Versions: 104

Compression:

Stored size: 535 Bytes

Contents

# frozen_string_literal: true

module ForemanAnsible
  # Service to generate a playbook given roles and a list of hosts
  class PlaybookCreator
    attr_reader :role_names

    def initialize(role_names)
      @role_names = role_names
    end

    def roles_playbook
      playbook = ['hosts' => 'all', 'roles' => role_names]
      playbook.to_yaml
    end

    def roles_tempfile
      tempfile = Tempfile.new("foreman-ansible-#{fqdn}-roles")
      tempfile.write(roles_playbook)
      tempfile.close
      tempfile
    end
  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
foreman_ansible-6.3.2 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-6.3.1 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-6.4.1 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-6.4.0 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-6.3.0 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-6.2.0 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-6.1.1 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-6.0.2 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-6.1.0 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-6.0.1 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-5.1.3 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-6.0.0 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-5.1.2 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-5.1.1 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-5.1.0 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-4.0.3.5 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-4.0.3.4 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-4.0.3.3 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-4.0.3.2 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-5.0.1 app/services/foreman_ansible/playbook_creator.rb