Remove a line from file and surrounding

I’m working on a playbook which would remove lines from a file containing specific hostname.
I want to use Ansible to remove the hostname AND surrounding lines. Here is an example of a block that I need to remove:

FileSet {
Name = “vcenter-hostname05”
Include {
Options {
signature = SHA1
compression=GZIP
noatime=yes
}
Plugin = “vsphere: server=vsphere-vcenter host=hostname05.domain.com abort_on_error”
}
}

Does anyone have a suggestion how would I match the lines when all I have is hostname05?

So far my best option is to run a command which invokes sed

You can use those modules, replace & lineinfile, to search for a pattern and replace it with something.
ansible.builtin.replace module – Replace all instances of a particular string in a file using a back-referenced regular expression — Ansible Documentation
ansible.builtin.lineinfile module – Manage lines in text files — Ansible Documentation
or use the shell module to work with sed!

Thank you Jeff!
I ended up using a shell script with sed.